summaryrefslogtreecommitdiff
path: root/libsn
diff options
context:
space:
mode:
authorMark McLoughlin <mark@skynet.ie>2005-02-28 08:42:25 +0000
committerMark McLoughlin <mark@skynet.ie>2005-02-28 08:42:25 +0000
commite21c7b303aee09cd0e577134f86f29e9abd83096 (patch)
treee3d9875c7c708b9274a46dbbcb54d9f8e85a2348 /libsn
parentb580496473e12f35ee289d387bf2f868d0d4171d (diff)
plug leak (append_string_to_list): don't strdup() @append.
Diffstat (limited to 'libsn')
-rw-r--r--libsn/sn-xmessages.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libsn/sn-xmessages.c b/libsn/sn-xmessages.c
index 44327f2..da7a8f4 100644
--- a/libsn/sn-xmessages.c
+++ b/libsn/sn-xmessages.c
@@ -534,14 +534,16 @@ sn_internal_serialize_message (const char *prefix,
return retval;
}
+/* Takes ownership of @append
+ */
static void
-append_string_to_list (char ***list,
- const char *append)
+append_string_to_list (char ***list,
+ char *append)
{
if (*list == NULL)
{
*list = sn_new0 (char*, 2);
- (*list)[0] = sn_internal_strdup (append);
+ (*list)[0] = append;
}
else
{
@@ -552,7 +554,7 @@ append_string_to_list (char ***list,
++i;
*list = sn_renew (char*, *list, i + 2);
- (*list)[i] = sn_internal_strdup (append);
+ (*list)[i] = append;
(*list)[i+1] = NULL;
}
}
@@ -691,6 +693,7 @@ parse_property (const char *str,
if (!unescape_string_inplace (p, &end))
{
sn_free (copy);
+ sn_free (name);
return FALSE;
}