aboutsummaryrefslogtreecommitdiff
path: root/src/my/my_query_helper.c
diff options
context:
space:
mode:
authorChristophe Genevey Metat <genevey.christophe@gmail.com>2016-06-10 12:32:40 +0000
committerChristophe Genevey Metat <genevey.christophe@gmail.com>2016-06-10 12:32:40 +0000
commitf06baa8a2c99545167142049f19f4a7bedfe1764 (patch)
tree185d0bba4ddd80c6c186183bc1cdf8d85815023c /src/my/my_query_helper.c
parent2f1634060e7d4aab5ff046ca50f1e21bae7471fb (diff)
downloadgnunet-f06baa8a2c99545167142049f19f4a7bedfe1764.tar.gz
gnunet-f06baa8a2c99545167142049f19f4a7bedfe1764.zip
finish to fix memory leak
Diffstat (limited to 'src/my/my_query_helper.c')
-rw-r--r--src/my/my_query_helper.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/my/my_query_helper.c b/src/my/my_query_helper.c
index c09422160..8ecfc2b64 100644
--- a/src/my/my_query_helper.c
+++ b/src/my/my_query_helper.c
@@ -21,6 +21,7 @@
21 * @file my/my_query_helper.c 21 * @file my/my_query_helper.c
22 * @brief library to help with access to a MySQL database 22 * @brief library to help with access to a MySQL database
23 * @author Christian Grothoff 23 * @author Christian Grothoff
24 * @author Christophe Genevey
24 */ 25 */
25#include "platform.h" 26#include "platform.h"
26#include <mysql/mysql.h> 27#include <mysql/mysql.h>
@@ -32,7 +33,7 @@
32 * by a #GNUNET_MY_QueryConverter. 33 * by a #GNUNET_MY_QueryConverter.
33 * 34 *
34 * @param cls closure 35 * @param cls closure
35 * @param rd result data to clean up 36 * @param qbind array of parameter to clean up
36 */ 37 */
37static void 38static void
38my_clean_query (void *cls, 39my_clean_query (void *cls,
@@ -119,7 +120,6 @@ my_conv_uint16 (void *cls,
119 120
120 GNUNET_assert (1 == qp->num_params); 121 GNUNET_assert (1 == qp->num_params);
121 122
122
123 u_nbo = GNUNET_new (uint16_t); 123 u_nbo = GNUNET_new (uint16_t);
124 if (NULL == u_nbo) 124 if (NULL == u_nbo)
125 return -1; 125 return -1;
@@ -143,13 +143,13 @@ struct GNUNET_MY_QueryParam
143GNUNET_MY_query_param_uint16 (const uint16_t *x) 143GNUNET_MY_query_param_uint16 (const uint16_t *x)
144{ 144{
145 struct GNUNET_MY_QueryParam res = { 145 struct GNUNET_MY_QueryParam res = {
146 .conv = &my_conv_uint16, 146 .conv = &my_conv_uint16,
147 .cleaner = &my_clean_query, 147 .cleaner = &my_clean_query,
148 .conv_cls = NULL, 148 .conv_cls = NULL,
149 .num_params = 1, 149 .num_params = 1,
150 .data = x, 150 .data = x,
151 .data_len = sizeof (*x) 151 .data_len = sizeof (*x)
152 }; 152 };
153 153
154 return res; 154 return res;
155} 155}
@@ -275,7 +275,7 @@ my_conv_rsa_public_key (void *cls,
275 size_t buf_size; 275 size_t buf_size;
276 276
277 GNUNET_assert(1 == qp->num_params); 277 GNUNET_assert(1 == qp->num_params);
278 // FIXME: this leaks memory right now... 278
279 buf_size = GNUNET_CRYPTO_rsa_public_key_encode (rsa, &buf); 279 buf_size = GNUNET_CRYPTO_rsa_public_key_encode (rsa, &buf);
280 280
281 qbind->buffer = (void *) buf; 281 qbind->buffer = (void *) buf;