aboutsummaryrefslogtreecommitdiff
path: root/src/regex
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-09-06 12:05:24 +0000
committerChristian Grothoff <christian@grothoff.org>2013-09-06 12:05:24 +0000
commit8675d5f1a8906b4255562f878e140acc0ee8fafc (patch)
tree40f140e61d6b2a5212d2aa94b7379ec0d9f03494 /src/regex
parent3a56bf7aa7e6de7d096cb509054b5dab1e50d119 (diff)
downloadgnunet-8675d5f1a8906b4255562f878e140acc0ee8fafc.tar.gz
gnunet-8675d5f1a8906b4255562f878e140acc0ee8fafc.zip
-misc fixes
Diffstat (limited to 'src/regex')
-rw-r--r--src/regex/regex_api.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/regex/regex_api.c b/src/regex/regex_api.c
index b22d78b90..afc028cdb 100644
--- a/src/regex/regex_api.c
+++ b/src/regex/regex_api.c
@@ -134,7 +134,10 @@ GNUNET_REGEX_announce (const struct GNUNET_CONFIGURATION_Handle *cfg,
134 a->cfg = cfg; 134 a->cfg = cfg;
135 a->client = GNUNET_CLIENT_connect ("regex", cfg); 135 a->client = GNUNET_CLIENT_connect ("regex", cfg);
136 if (NULL == a->client) 136 if (NULL == a->client)
137 {
138 GNUNET_free (a);
137 return NULL; 139 return NULL;
140 }
138 a->msg.header.type = htons (GNUNET_MESSAGE_TYPE_REGEX_ANNOUNCE); 141 a->msg.header.type = htons (GNUNET_MESSAGE_TYPE_REGEX_ANNOUNCE);
139 a->msg.header.size = htons (slen + sizeof (struct AnnounceMessage)); 142 a->msg.header.size = htons (slen + sizeof (struct AnnounceMessage));
140 a->msg.compression = htons (compression); 143 a->msg.compression = htons (compression);
@@ -299,11 +302,14 @@ GNUNET_REGEX_search (const struct GNUNET_CONFIGURATION_Handle *cfg,
299 size_t slen; 302 size_t slen;
300 303
301 slen = strlen (string) + 1; 304 slen = strlen (string) + 1;
302 s = GNUNET_malloc (sizeof (struct GNUNET_REGEX_Search)); 305 s = GNUNET_new (struct GNUNET_REGEX_Search);
303 s->cfg = cfg; 306 s->cfg = cfg;
304 s->client = GNUNET_CLIENT_connect ("regex", cfg); 307 s->client = GNUNET_CLIENT_connect ("regex", cfg);
305 if (NULL == s->client) 308 if (NULL == s->client)
309 {
310 GNUNET_free (s);
306 return NULL; 311 return NULL;
312 }
307 s->callback = callback; 313 s->callback = callback;
308 s->callback_cls = callback_cls; 314 s->callback_cls = callback_cls;
309 s->msg = GNUNET_malloc (sizeof (struct SearchMessage) + slen); 315 s->msg = GNUNET_malloc (sizeof (struct SearchMessage) + slen);