From ba9b94a0c62ca4b7673b41ae52dbe49713302e09 Mon Sep 17 00:00:00 2001 From: Eric House Date: Thu, 16 Nov 2017 08:18:39 -0800 Subject: [PATCH] move g_free after last use of ptr (Made same on another branch but couldn't cherry-pick) --- xwords4/linux/relaycon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xwords4/linux/relaycon.c b/xwords4/linux/relaycon.c index 050e477fa..0519177dd 100644 --- a/xwords4/linux/relaycon.c +++ b/xwords4/linux/relaycon.c @@ -257,12 +257,13 @@ relaycon_receive( GIOChannel* source, GIOCondition XP_UNUSED_DBG(condition), gpo gchar* b64 = g_base64_encode( (const guchar*)buf, ((0 <= nRead)? nRead : 0) ); XP_LOGF( "%s: read %zd bytes ('%s')", __func__, nRead, b64 ); - g_free( b64 ); #ifdef COMMS_CHECKSUM gchar* sum = g_compute_checksum_for_data( G_CHECKSUM_MD5, buf, nRead ); XP_LOGF( "%s: read %zd bytes ('%s')(sum=%s)", __func__, nRead, b64, sum ); g_free( sum ); #endif + g_free( b64 ); + if ( 0 <= nRead ) { const XP_U8* ptr = buf; const XP_U8* end = buf + nRead;