service: fix double free bug when dealing with data
authorFelix Fietkau <nbd@nbd.name>
Tue, 17 Dec 2024 20:27:59 +0000 (21:27 +0100)
committerFelix Fietkau <nbd@nbd.name>
Tue, 17 Dec 2024 20:28:00 +0000 (21:28 +0100)
clear the stale pointer

Signed-off-by: Felix Fietkau <nbd@nbd.name>
service/service.c

index 25e28853a72d94211c5fbecd664949311b083292..515c9922843cfdcd25e4dd37b520ec9cd3d94b81 100644 (file)
@@ -205,6 +205,7 @@ service_delete(struct service *s, bool container)
 {
        blobmsg_list_free(&s->data_blob);
        free(s->data);
+       s->data = NULL;
        vlist_flush_all(&s->instances);
        s->deleted = true;
        service_stopped(s);