Commit 979071e8 authored by David Gibson's avatar David Gibson

Fix missing va_end()s

This corrects several places in ccan where stdarg.h is used but there is a
missing va_end().  You can get away with this on many platforms, but not
all.

Caught by Coverity scan.
Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
parent dcc0a08c
......@@ -1085,8 +1085,8 @@ int failtest_open(const char *pathname,
call.closed = false;
if (call.flags & O_CREAT) {
call.mode = va_arg(ap, int);
va_end(ap);
}
va_end(ap);
p = add_history(FAILTEST_OPEN, true, file, line, &call);
/* Avoid memory leak! */
if (p == &unrecorded_call)
......
......@@ -357,6 +357,7 @@ enum line_compiled get_ccan_line_pp(struct pp_conditions *cond,
}
ret = get_pp(cond, head);
tal_free(head);
va_end(ap);
return ret;
}
......
......@@ -27,6 +27,7 @@ bool run_gcov(const void *ctx, unsigned int *time_ms, char **output,
args = tal_vfmt(ctx, fmt, ap);
rc = run_command(ctx, time_ms, output, "%s %s", cmd, args);
tal_free(args);
va_end(ap);
return rc;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment