Skip to content

Commit ab3eb5b

Browse files
committed
fix use-after-free
1 parent 896f788 commit ab3eb5b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/dbus.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,16 +628,16 @@ static void dbus_cb_dunst_RuleEnable(GDBusConnection *connection,
628628
}
629629

630630
struct rule *target_rule = get_rule(name);
631-
g_free(name);
632-
633631
if (target_rule == NULL) {
634632
g_dbus_method_invocation_return_error(invocation,
635633
G_DBUS_ERROR,
636634
G_DBUS_ERROR_INVALID_ARGS,
637635
"There is no rule named \"%s\"",
638636
name);
637+
g_free(name);
639638
return;
640639
}
640+
g_free(name);
641641

642642
if (state == 0)
643643
target_rule->enabled = false;

0 commit comments

Comments
 (0)