This patch fixes memory leak on loading service passphrase.
g_strdup() function returns NULL only when nameserver will be NULL and
it has already been checked before so there is no need to check for
return of g_strdup().
Change-Id: I3ddd3af135a35ba03bd01ccd5a68f822ed1dac26
Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
if (str)
service->passphrase = str;
+ g_key_file_free(keyfile);
+
return 0;
}
return -ENOMEM;
nameservers[len] = g_strdup(nameserver);
- if (!nameservers[len])
- return -ENOMEM;
-
nameservers[len + 1] = NULL;
#ifdef TIZEN_EXT