From a25f9e5cc713b885b51c941781f393905c66d1db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20H=C3=A4rdeman?= Date: Mon, 21 May 2007 14:56:37 +0200 Subject: Free some temporarily allocated memory --- metaentry.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'metaentry.c') diff --git a/metaentry.c b/metaentry.c index a2ab65b..e9d2566 100644 --- a/metaentry.c +++ b/metaentry.c @@ -37,7 +37,6 @@ #include "metaentry.h" #include "utils.h" -#if 0 /* Free's a metaentry and all its parameters */ static void mentry_free(struct metaentry *m) @@ -62,7 +61,6 @@ mentry_free(struct metaentry *m) free(m); } -#endif /* Allocates an empty metahash table */ static struct metahash * @@ -239,6 +237,7 @@ mentry_create(const char *path) if (lsize < 0) { msg(MSG_ERROR, "listxattr failed for %s: %s\n", path, strerror(errno)); + free(list); return NULL; } @@ -267,6 +266,8 @@ mentry_create(const char *path) if (vsize < 0) { msg(MSG_ERROR, "getxattr failed for %s: %s\n", path, strerror(errno)); + free(list); + mentry_free(mentry); return NULL; } @@ -277,11 +278,14 @@ mentry_create(const char *path) if (vsize < 0) { msg(MSG_ERROR, "getxattr failed for %s: %s\n", path, strerror(errno)); + free(list); + mentry_free(mentry); return NULL; } i++; } + free(list); return mentry; } -- cgit v1.2.1