From a131c9b98d4c40fbbc08d7bf0e0cc0fe3d37beda Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 5 Jan 2009 02:45:04 +0100 Subject: [PATCH] Fix memory leak in loading function --- src/device.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/device.c b/src/device.c index 9866918..1bc0d83 100644 --- a/src/device.c +++ b/src/device.c @@ -1209,7 +1209,7 @@ static int device_load(struct connman_device *device) GKeyFile *keyfile; gchar *pathname, *data = NULL; gsize length; - const char *str; + char *str; DBG("device %p", device); @@ -1236,8 +1236,10 @@ static int device_load(struct connman_device *device) g_free(data); str = g_key_file_get_string(keyfile, "Configuration", "Policy", NULL); - if (str != NULL) + if (str != NULL) { device->policy = string2policy(str); + g_free(str); + } g_key_file_free(keyfile); -- 2.7.4