platform: fix a memory leak on an error

This commit is contained in:
Jiří Klimeš 2013-09-23 18:15:21 +02:00
parent a3f3d76b24
commit 28530239fa

View file

@ -1311,6 +1311,7 @@ sysctl_get (NMPlatform *platform, const char *path)
if (!g_file_get_contents (path, &contents, NULL, &error)) {
error ("error reading %s: %s", path, error->message);
g_clear_error (&error);
return NULL;
}