Skip to content

Commit 3f0ebd3

Browse files
kr-tcasaroli
andcommitted
fix(workdir): free before the context
Co-authored-by: Marco Casaroli <casaroli@users.noreply.github.com> Signed-off-by: Krisztian <34309983+kr-t@users.noreply.github.com>
1 parent 9d2db4d commit 3f0ebd3

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/ocre/context.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,10 @@ struct ocre_context *ocre_context_create(const char *workdir)
110110
return context;
111111

112112
error:
113-
free(context);
114-
free(context->working_directory);
113+
if (context) {
114+
free(context->working_directory);
115+
}
116+
free(context);
115117

116118
return NULL;
117119
};

0 commit comments

Comments
 (0)