From: Eric Biggers Date: Thu, 24 Apr 2014 18:32:59 +0000 (-0500) Subject: load_prepopulate_pats(): Fix free X-Git-Tag: v1.7.0~273 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=b3562d219976321899ea77bf36c25adf756c7447;ds=sidebyside load_prepopulate_pats(): Fix free --- diff --git a/src/win32_apply.c b/src/win32_apply.c index 2b0d5a4b..c182862e 100644 --- a/src/win32_apply.c +++ b/src/win32_apply.c @@ -59,14 +59,6 @@ set_prepopulate_pats(struct apply_ctx *ctx, struct string_set *s) ctx->private[2] = (intptr_t)s; } -static struct string_set * -alloc_prepopulate_pats(struct apply_ctx *ctx) -{ - struct string_set *s = CALLOC(1, sizeof(*s)); - set_prepopulate_pats(ctx, s); - return s; -} - static struct string_set * get_prepopulate_pats(struct apply_ctx *ctx) { @@ -118,7 +110,7 @@ load_prepopulate_pats(struct apply_ctx *ctx) if (ret) return ret; - s = alloc_prepopulate_pats(ctx); + s = CALLOC(1, sizeof(struct string_set)); if (!s) { FREE(buf); return WIMLIB_ERR_NOMEM; @@ -133,9 +125,10 @@ load_prepopulate_pats(struct apply_ctx *ctx) mangle_pat); FREE(buf); if (ret) { - free_prepopulate_pats(ctx); + FREE(s); return ret; } + set_prepopulate_pats(ctx, s); ctx->private[3] = (intptr_t)mem; return 0; }