Whamcloud - gitweb
libquota: fix memory leak (on error path)
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 12 Dec 2013 18:13:51 +0000 (13:13 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 12 Dec 2013 18:13:59 +0000 (13:13 -0500)
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/quota/mkquota.c

index a0d3a2a..3aa8100 100644 (file)
@@ -230,6 +230,7 @@ errcode_t quota_init_context(quota_ctx_t *qctx, ext2_filsys fs, int qtype)
                err = ext2fs_get_mem(sizeof(dict_t), &dict);
                if (err) {
                        log_err("Failed to allocate dictionary");
+                       quota_release_context(&ctx);
                        return err;
                }
                ctx->quota_dict[i] = dict;