storage: Using the right free func
authorFlavio Ceolin <flavio.ceolin@profusion.mobi>
Thu, 5 Jan 2012 10:01:45 +0000 (11:01 +0100)
committerDaniel Wagner <daniel.wagner@bmw-carit.de>
Thu, 5 Jan 2012 10:01:45 +0000 (11:01 +0100)
Fixing a segfault when it fails to store an information,
just using g_error_free instead of g_free.

src/storage.c

index 7dcf2e3..54c023d 100644 (file)
@@ -68,7 +68,7 @@ static void storage_save(GKeyFile *keyfile, char *pathname)
 
        if (!g_file_set_contents(pathname, data, length, &error)) {
                DBG("Failed to store information: %s", error->message);
-               g_free(error);
+               g_error_free(error);
        }
 
        g_free(data);