summaryrefslogtreecommitdiffhomepage
path: root/main.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2024-12-08 13:17:54 +0100
committerFelix Fietkau <nbd@nbd.name>2024-12-08 13:19:56 +0100
commit4efad5388184a2fd76957f0300eeab1a3b1eee2f (patch)
tree6d66042238d10cac0c276a92552e7c669772be46 /main.c
parent1b8660d33fb7eae7b8f66aa78098ffe8c3de0689 (diff)
main: fix crash on printing -p output
Delete a duplicate ucv_put() line that can lead to a double-free bug. Reproduced by running: ucode -l nl80211 -p 'sprintf("%.J\n", nl80211.request(nl80211.const.NL80211_CMD_GET_WIPHY, nl80211.const.NLM_F_DUMP, { wiphy: 0, split_wiphy_dump: true }))' Fixes: 0a7ff4715cb8 ("main: pretty-print `-p` output by default") Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'main.c')
-rw-r--r--main.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/main.c b/main.c
index e7771b7..1faaba5 100644
--- a/main.c
+++ b/main.c
@@ -155,8 +155,6 @@ compile(uc_vm_t *vm, uc_source_t *src, FILE *precompile, bool strip, char *inter
fwrite(pb->buf, pb->bpos, 1, stdout);
printbuf_free(pb);
}
-
- ucv_put(res);
}
rc = 0;