Commit 9c4270bc authored by Simon Kelley's avatar Simon Kelley

Fix memory leak.

parent 46b06656
...@@ -340,9 +340,11 @@ static DBusMessage* dbus_read_servers_ex(DBusMessage *message, int strings) ...@@ -340,9 +340,11 @@ static DBusMessage* dbus_read_servers_ex(DBusMessage *message, int strings)
} }
/* dup the string because it gets modified during parsing */ /* dup the string because it gets modified during parsing */
if (dup)
free(dup);
if (!(dup = str_domain = whine_malloc(strlen(str)+1))) if (!(dup = str_domain = whine_malloc(strlen(str)+1)))
break; break;
strcpy(str_domain, str); strcpy(str_domain, str);
/* point to address part of old string for error message */ /* point to address part of old string for error message */
...@@ -400,9 +402,11 @@ static DBusMessage* dbus_read_servers_ex(DBusMessage *message, int strings) ...@@ -400,9 +402,11 @@ static DBusMessage* dbus_read_servers_ex(DBusMessage *message, int strings)
} }
/* dup the string because it gets modified during parsing */ /* dup the string because it gets modified during parsing */
if (dup)
free(dup);
if (!(dup = str_addr = whine_malloc(strlen(str)+1))) if (!(dup = str_addr = whine_malloc(strlen(str)+1)))
break; break;
strcpy(str_addr, str); strcpy(str_addr, str);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment