git.openpandora.org
/
pandora-libraries.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b672d75
)
Fixed a memleak I recently added
author
skeezix
<skeezix@flotsam-vm.(none)>
Sun, 11 Oct 2009 12:45:31 +0000
(08:45 -0400)
committer
skeezix
<skeezix@flotsam-vm.(none)>
Sun, 11 Oct 2009 12:45:31 +0000
(08:45 -0400)
lib/pnd_desktop.c
patch
|
blob
|
history
diff --git
a/lib/pnd_desktop.c
b/lib/pnd_desktop.c
index
3bb3066
..
c2cffec
100644
(file)
--- 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 );
}