summaryrefslogtreecommitdiffstats
path: root/patches/connman-0.78/0002-storage-Using-the-right-free-func.patch
blob: b297b52db586a1e1e321692476caddedbd151da5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
From 950569f6b46e141ccaf48d834438925ddb261baf Mon Sep 17 00:00:00 2001
From: Flavio Ceolin <flavio.ceolin@profusion.mobi>
Date: Thu, 5 Jan 2012 11:01:45 +0100
Subject: [PATCH] storage: Using the right free func

Fixing a segfault when it fails to store an information,
just using g_error_free instead of g_free.
---
 src/storage.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/storage.c b/src/storage.c
index 7dcf2e3..54c023d 100644
--- a/src/storage.c
+++ b/src/storage.c
@@ -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);