From 9ed00818d7351ca5bcb4ba16b5dfe900d45831d5 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 25 Nov 2012 18:39:11 +0000 Subject: Fixed one potential memory leak, and re-remembered that for GLib + valgrind you REALLY need to set G_SLICE=always-malloc. Argh! --- nick.c | 4 ++++ protocols/twitter/twitter_lib.c | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/nick.c b/nick.c index 0d394ecb..4b7e71d0 100644 --- a/nick.c +++ b/nick.c @@ -133,7 +133,10 @@ char *nick_gen( bee_user_t *bu ) { chop = fmt[1]; if( chop == '\0' ) + { + g_string_free( ret, TRUE ); return NULL; + } fmt += 2; } else if( isdigit( *fmt ) ) @@ -186,6 +189,7 @@ char *nick_gen( bee_user_t *bu ) } else { + g_string_free( ret, TRUE ); return NULL; } } diff --git a/protocols/twitter/twitter_lib.c b/protocols/twitter/twitter_lib.c index b888a730..fe276133 100644 --- a/protocols/twitter/twitter_lib.c +++ b/protocols/twitter/twitter_lib.c @@ -270,7 +270,6 @@ static gboolean twitter_xt_get_friends_id_list(json_value *node, struct twitter_ txl->list = g_slist_prepend(txl->list, g_strdup_printf("%lld", c->u.array.values[i]->u.integer)); - } c = json_o_get(node, "next_cursor"); -- cgit v1.2.3