/soc/2015/jgeboski/facebook: e0df3850e9c2: facebook: fixed memor...

James Geboski <[email protected]>
Newsgroups gmane.comp.gnome.gaim.cvs
Message-ID <[email protected]>
Changeset: e0df3850e9c222d9ec799914556f513b6c613f68
Author:	 James Geboski <[email protected]>
Date:	 2015-08-20 16:31 -0400
Branch:	 facebook
URL: https://hg.pidgin.im/soc/2015/jgeboski/facebook/rev/e0df3850e9c2

Description:

facebook: fixed memory leak with HTTP error checking

diffstat:

 libpurple/protocols/facebook/api.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (24 lines):

diff --git a/libpurple/protocols/facebook/api.c b/libpurple/protocols/facebook/api.c
--- a/libpurple/protocols/facebook/api.c
+++ b/libpurple/protocols/facebook/api.c
@@ -625,12 +625,16 @@ fb_api_http_chk(FbApi *api, PurpleHttpCo
 		FB_API_ERROR_EMIT(api, err, return FALSE);
 	}
 
-	if (fb_api_json_chk(api, data, size, root)) {
-		FB_API_ERROR_EMIT(api, err, return FALSE);
-		return TRUE;
+	if (!fb_api_json_chk(api, data, size, root)) {
+		if (G_UNLIKELY(err != NULL)) {
+			g_error_free(err);
+		}
+
+		return FALSE;
 	}
 
-	return FALSE;
+	FB_API_ERROR_EMIT(api, err, return FALSE);
+	return TRUE;
 }
 
 static PurpleHttpConnection *

_______________________________________________
Commits mailing list
[email protected]
https://pidgin.im/cgi-bin/mailman/listinfo/commits
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.