Skip to content

Commit

Permalink
main: fix crash on printing -p output
Browse files Browse the repository at this point in the history
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: 0a7ff47 ("main: pretty-print `-p` output by default")
Signed-off-by: Felix Fietkau <[email protected]>
  • Loading branch information
nbd168 committed Dec 8, 2024
1 parent 1b8660d commit 4efad53
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4efad53

Please sign in to comment.