From 79ddf1048486d1a77a1aee9b8152c8ffb25d8a11 Mon Sep 17 00:00:00 2001 From: James Booth Date: Tue, 17 Jun 2014 23:34:52 +0100 Subject: Fixed memleaks with otr policy and autoaway options --- src/otr/otr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/otr') diff --git a/src/otr/otr.c b/src/otr/otr.c index 501c7583..7a5733bf 100644 --- a/src/otr/otr.c +++ b/src/otr/otr.c @@ -527,15 +527,15 @@ _otr_get_policy(const char * const recipient) // check contact specific setting if (g_list_find_custom(account->otr_manual, recipient, (GCompareFunc)g_strcmp0)) { account_free(account); - return "manual"; + return strdup("manual"); } if (g_list_find_custom(account->otr_opportunistic, recipient, (GCompareFunc)g_strcmp0)) { account_free(account); - return "opportunistic"; + return strdup("opportunistic"); } if (g_list_find_custom(account->otr_always, recipient, (GCompareFunc)g_strcmp0)) { account_free(account); - return "always"; + return strdup("always"); } // check default account setting @@ -551,7 +551,7 @@ _otr_get_policy(const char * const recipient) result = "always"; } account_free(account); - return result; + return strdup(result); } account_free(account); -- cgit 1.4.1-2-gfad0