Skip to content

Commit

Permalink
udisks2: check if variables are NULL before calling unref
Browse files Browse the repository at this point in the history
Signed-off-by: Sergio Correia <scorreia@redhat.com>
  • Loading branch information
sergio-correia committed May 9, 2024
1 parent 4bddd5e commit eea777f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/luks/udisks2/clevis-luks-udisks2.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,10 @@ child_main(int sock)

error:
g_list_free_full(ctx.lst, g_free);
g_main_loop_unref(ctx.loop);
g_object_unref(ctx.clt);
if (ctx.loop)
g_main_loop_unref(ctx.loop);
if (ctx.clt)
g_object_unref(ctx.clt);
close(sock);
return exit_status;
}
Expand Down

0 comments on commit eea777f

Please sign in to comment.