aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2010-12-08 10:24:30 +0000
committerSamuel Ortiz <sameo@linux.intel.com>2010-12-10 12:50:27 +0100
commit7e64b827a2763d74814f81be03ccca350bb2cc3b (patch)
tree947e6d3fb40df4832480e52fd544e5a76072b935
parent92fed3285cf5c1a3fb56d03fcb0cf79014b518cb (diff)
downloadpacrunner-7e64b827a2763d74814f81be03ccca350bb2cc3b.tar.gz
libproxy: Free scheme string sooner, now it's not needed in extract_result()
-rw-r--r--libproxy/proxy.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/libproxy/proxy.c b/libproxy/proxy.c
index adb8282..1d2e0ad 100644
--- a/libproxy/proxy.c
+++ b/libproxy/proxy.c
@@ -66,7 +66,7 @@ void px_proxy_factory_free(pxProxyFactory *factory)
free(factory);
}
-static char **extract_result(const char *str, const char *scheme)
+static char **extract_result(const char *str)
{
char **result;
@@ -142,16 +142,15 @@ char **px_proxy_factory_get_proxies(pxProxyFactory *factory, const char *url)
dbus_message_append_args(msg, DBUS_TYPE_STRING, &url,
DBUS_TYPE_STRING, &host, DBUS_TYPE_INVALID);
+ free(scheme);
reply = dbus_connection_send_with_reply_and_block(factory->conn,
msg, -1, NULL);
dbus_message_unref(msg);
- if (reply == NULL) {
- free(scheme);
+ if (reply == NULL)
goto direct;
- }
dbus_message_get_args(reply, NULL, DBUS_TYPE_STRING, &str,
DBUS_TYPE_INVALID);
@@ -159,9 +158,7 @@ char **px_proxy_factory_get_proxies(pxProxyFactory *factory, const char *url)
if (str == NULL || strlen(str) == 0)
str = "DIRECT";
- result = extract_result(str, scheme);
-
- free(scheme);
+ result = extract_result(str);
dbus_message_unref(reply);