From 67360d96cd326bff74a8ff55eee38a60db49fb91 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Wed, 4 Oct 2000 21:55:53 +0000 Subject: Fix a case where a variable was free'd and then possibly used in an error * providers/mbox/camel-mbox-store.c (get_folder): Fix a case where a variable was free'd and then possibly used in an error message. svn path=/trunk/; revision=5722 --- camel/providers/mbox/camel-mbox-store.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'camel/providers') diff --git a/camel/providers/mbox/camel-mbox-store.c b/camel/providers/mbox/camel-mbox-store.c index 8bf77c9774..7ad9333b91 100644 --- a/camel/providers/mbox/camel-mbox-store.c +++ b/camel/providers/mbox/camel-mbox-store.c @@ -137,14 +137,15 @@ get_folder (CamelStore *store, const char *folder_name, gboolean create, } fd = open (name, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR); - g_free (name); if (fd == -1) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, "Could not create file `%s':" "\n%s", name, g_strerror (errno)); + g_free (name); return NULL; } + g_free (name); close (fd); } else if (!S_ISREG (st.st_mode)) { camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER, -- cgit v1.2.3