Skip to content

Commit b4cd47c

Browse files
authored
src: end va_list before returning (#618)
Explicitly end the `va_list` before returning in the `ffStrbufSetF()` function as `va_list`s are not ended implicitly.
1 parent ac654ff commit b4cd47c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/util/FFstrbuf.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,11 @@ void ffStrbufSetF(FFstrbuf* strbuf, const char* format, ...)
167167
va_list arguments;
168168
va_start(arguments, format);
169169

170-
if(strbuf->allocated == 0)
171-
return ffStrbufInitVF(strbuf, format, arguments);
170+
if(strbuf->allocated == 0) {
171+
ffStrbufInitVF(strbuf, format, arguments);
172+
va_end(arguments);
173+
return;
174+
}
172175

173176
ffStrbufClear(strbuf);
174177
ffStrbufAppendVF(strbuf, format, arguments);

0 commit comments

Comments
 (0)