From: skeezix Date: Sun, 11 Oct 2009 12:45:31 +0000 (-0400) Subject: Fixed a memleak I recently added X-Git-Tag: Release-2010-05/1~156^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8378234d0e11bbf28043c1c2dbc1b663c158f81f;p=pandora-libraries.git Fixed a memleak I recently added --- diff --git a/lib/pnd_desktop.c b/lib/pnd_desktop.c index 3bb3066..c2cffec 100644 --- a/lib/pnd_desktop.c +++ b/lib/pnd_desktop.c @@ -381,10 +381,15 @@ int pnd_map_dotdesktop_categories ( pnd_conf_handle c, char *target_buffer, unsi // given category 'foo', look it up in the provided config map. return the char* reference, or NULL char *pnd_map_dotdesktop_category ( pnd_conf_handle c, char *single_category ) { char *key; + char *ret; key = malloc ( strlen ( single_category ) + 4 + 1 ); sprintf ( key, "map.%s", single_category ); - return ( pnd_conf_get_as_char ( c, key ) ); + ret = pnd_conf_get_as_char ( c, key ); + + free ( key ); + + return ( ret ); }