Skip to content

Commit

Permalink
Fix deref after null
Browse files Browse the repository at this point in the history
ctx may be NULL at 178 line
  • Loading branch information
Goblenus committed Dec 16, 2021
1 parent dd2fcc1 commit 209aee6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion providers/implementations/storemgmt/file_store.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,9 @@ static void *file_open_dir(const char *path, const char *uri, void *provctx)
}
return ctx;
err:
file_close(ctx);
if (ctx != NULL)
file_close(ctx);

return NULL;
}

Expand Down Expand Up @@ -762,6 +764,9 @@ static int file_close_stream(struct file_ctx_st *ctx)

static int file_close(void *loaderctx)
{
if (loaderctx == NULL)
assert(0);

struct file_ctx_st *ctx = loaderctx;

switch (ctx->type) {
Expand Down

0 comments on commit 209aee6

Please sign in to comment.