From 6e5681d2ee82fcbacabc1f74edb93d2ce4c25e85 Mon Sep 17 00:00:00 2001 From: Ricardo Branco Date: Sat, 23 Mar 2024 07:20:20 +0100 Subject: [PATCH] Fix stupid free bug --- bsd/restartable.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bsd/restartable.c b/bsd/restartable.c index e20d4fb..7bd8947 100644 --- a/bsd/restartable.c +++ b/bsd/restartable.c @@ -82,6 +82,7 @@ safe_arg(const char *arg) { static void print_argv(pid_t pid) { char **argv = kinfo_getargv(pid); + char **argvp = argv; if (argv == NULL) { warn("%d: kinfo_getargv", pid); @@ -93,7 +94,7 @@ print_argv(pid_t pid) { } while (*++argv); printf("\n"); - free_argv(argv); + free_argv(argvp); } static void