From fbe7f1e89dcce77c1565b7644b37809345a0e0ba Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sat, 10 Oct 2015 11:48:52 +0200 Subject: [PATCH] Closed memory leak with assert error or memory shortage while creating SL entry. Coverity CID 12576. --- libisofs/rockridge.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libisofs/rockridge.c b/libisofs/rockridge.c index 1d25e68..9491a2d 100644 --- a/libisofs/rockridge.c +++ b/libisofs/rockridge.c @@ -577,12 +577,15 @@ int rrip_add_SL(Ecma119Image *t, struct susp_info *susp, uint8_t **comp, * debug purposes */ if (ce == 0) { + free(SL); return ISO_ASSERT_FAILURE; } ret = susp_append_ce(t, susp, SL); if (ret < 0) { + free(SL); return ret; } + SL = NULL; /* now owned by susp */ written = i; total_comp_len = comp[i][1] + 2; }