Skip to content

Commit b1197ca

Browse files
udisks2: check if variables are NULL before calling unref
Signed-off-by: Sergio Correia <[email protected]>
1 parent 52c2b24 commit b1197ca

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/luks/udisks2/clevis-luks-udisks2.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,10 @@ child_main(int sock)
264264

265265
error:
266266
g_list_free_full(ctx.lst, g_free);
267-
g_main_loop_unref(ctx.loop);
268-
g_object_unref(ctx.clt);
267+
if (ctx.loop)
268+
g_main_loop_unref(ctx.loop);
269+
if (ctx.clt)
270+
g_object_unref(ctx.clt);
269271
close(sock);
270272
return exit_status;
271273
}

0 commit comments

Comments
 (0)