Fix memory leak.

This commit is contained in:
Simon Kelley committed 2013-02-04 22:07:57 +00:00
1 parent 46b066565e
commit 9c4270bcd9
1 file changed
+6 -2
+6 -2
View File
@@ -340,9 +340,11 @@ static DBusMessage* dbus_read_servers_ex(DBusMessage *message, int strings)
}
/* dup the string because it gets modified during parsing */
if (dup)
free(dup);
if (!(dup = str_domain = whine_malloc(strlen(str)+1)))
break;
strcpy(str_domain, str);
/* point to address part of old string for error message */
@@ -400,9 +402,11 @@ static DBusMessage* dbus_read_servers_ex(DBusMessage *message, int strings)
}
/* dup the string because it gets modified during parsing */
if (dup)
free(dup);
if (!(dup = str_addr = whine_malloc(strlen(str)+1)))
break;
strcpy(str_addr, str);
}