Merge lp:~linuxjedi/libdrizzle/5.1-valgrind-fixes into lp:libdrizzle

Proposed by Andrew Hutchings
Status: Merged
Approved by: Andrew Hutchings
Approved revision: 65
Merged at revision: 65
Proposed branch: lp:~linuxjedi/libdrizzle/5.1-valgrind-fixes
Merge into: lp:libdrizzle
Diff against target: 83 lines (+19/-4)
5 files modified
.bzrignore (+1/-1)
libdrizzle/result.cc (+11/-2)
libdrizzle/statement.cc (+5/-1)
tests/unit/column.c (+1/-0)
tests/unit/row.c (+1/-0)
To merge this branch: bzr merge lp:~linuxjedi/libdrizzle/5.1-valgrind-fixes
Reviewer Review Type Date Requested Status
Andrew Hutchings Approve
Review via email: mp+141396@code.launchpad.net

Description of the change

Fix valgrind leaks and errors

To post a comment you must log in.
Revision history for this message
Andrew Hutchings (linuxjedi) wrote :

needs merging to fix Jenkins failures

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2012-12-21 13:17:29 +0000
3+++ .bzrignore 2012-12-28 10:40:32 +0000
4@@ -29,7 +29,7 @@
5 libdrizzle/.libs/
6 libdrizzle/*.la
7 libdrizzle/*.lo
8-libdrizzle-5.0/version.h
9+libdrizzle-*/version.h
10 m4/libtool.m4
11 m4/ltoptions.m4
12 m4/ltsugar.m4
13
14=== modified file 'libdrizzle/result.cc'
15--- libdrizzle/result.cc 2012-12-23 01:05:57 +0000
16+++ libdrizzle/result.cc 2012-12-28 10:40:32 +0000
17@@ -90,6 +90,8 @@
18 result->info[0]= '\0';
19 result->sqlstate[0]= '\0';
20 result->null_bitmap_list= NULL;
21+ result->null_bitmap= NULL;
22+ result->binary_rows= false;
23
24 result->con= con;
25 con->result= result;
26@@ -131,8 +133,15 @@
27 for (x= 0; x < result->row_count; x++)
28 {
29 drizzle_row_free(result, result->row_list[x]);
30- }
31-
32+ if (result->null_bitmap_list != NULL)
33+ {
34+ free(result->null_bitmap_list[x]);
35+ }
36+ }
37+ if (result->null_bitmap_list != NULL)
38+ {
39+ free(result->null_bitmap_list);
40+ }
41 free(result->row_list);
42 free(result->field_sizes_list);
43 }
44
45=== modified file 'libdrizzle/statement.cc'
46--- libdrizzle/statement.cc 2012-12-23 10:47:57 +0000
47+++ libdrizzle/statement.cc 2012-12-28 10:40:32 +0000
48@@ -567,7 +567,11 @@
49
50 free(stmt->null_bitmap);
51 free(stmt->query_params);
52- free(stmt->result_params);
53+ if (stmt->result_params)
54+ {
55+ free(stmt->result_params->data);
56+ free(stmt->result_params);
57+ }
58 if (stmt->execute_result)
59 {
60 drizzle_result_free(stmt->execute_result);
61
62=== modified file 'tests/unit/column.c'
63--- tests/unit/column.c 2012-12-27 07:49:01 +0000
64+++ tests/unit/column.c 2012-12-28 10:40:32 +0000
65@@ -64,6 +64,7 @@
66 if (ret != DRIZZLE_RETURN_OK)
67 {
68 printf("Drizzle connection failure\n");
69+ drizzle_quit(con);
70 return EXIT_SKIP;
71 }
72
73
74=== modified file 'tests/unit/row.c'
75--- tests/unit/row.c 2012-12-27 22:09:42 +0000
76+++ tests/unit/row.c 2012-12-28 10:40:32 +0000
77@@ -64,6 +64,7 @@
78 if (ret != DRIZZLE_RETURN_OK)
79 {
80 printf("Drizzle connection failure\n");
81+ drizzle_quit(con);
82 return EXIT_SKIP;
83 }
84

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: