diff options
author | xypron.glpk@gmx.de | 2017-07-30 21:40:37 +0200 |
---|---|---|
committer | Tom Rini | 2017-08-13 15:17:29 -0400 |
commit | 36d35345b1f6124d7e1763c818ec29e1709f9eec (patch) | |
tree | 7310eb198cfa77c87542a26cdc120d199ba0347b /lib/tpm.c | |
parent | 2d5e86b110e7287beba0627c41dab795e8d17aea (diff) |
tpm: add missing va_end
va_start must always be matched by va_end.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'lib/tpm.c')
-rw-r--r-- | lib/tpm.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/tpm.c b/lib/tpm.c index fb520e3d733..d1cf5a8a167 100644 --- a/lib/tpm.c +++ b/lib/tpm.c @@ -95,8 +95,10 @@ int pack_byte_string(uint8_t *str, size_t size, const char *format, ...) return -1; } - if (offset + length > size) + if (offset + length > size) { + va_end(args); return -1; + } switch (*format) { case 'b': @@ -163,6 +165,7 @@ int unpack_byte_string(const uint8_t *str, size_t size, const char *format, ...) length = va_arg(args, uint32_t); break; default: + va_end(args); debug("Couldn't recognize format string\n"); return -1; } |