diff options
author | David Härdeman <david@hardeman.nu> | 2007-05-21 14:56:37 +0200 |
---|---|---|
committer | David Härdeman <david@hardeman.nu> | 2007-05-21 14:56:37 +0200 |
commit | a25f9e5cc713b885b51c941781f393905c66d1db (patch) | |
tree | 497d19ca5dc8d25d0ddaba1de265312c62856e13 /metaentry.c | |
parent | 36d91ba2fe1ecc8120a252c12c19729519bdb078 (diff) |
Free some temporarily allocated memory
Diffstat (limited to 'metaentry.c')
-rw-r--r-- | metaentry.c | 8 |
1 files changed, 6 insertions, 2 deletions
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; } |