libsepol: destroy the copied va_list

va_copy()'s manpage [1] states:

    Each invocation of va_copy() must be matched by a corresponding
    invocation of va_end() in the same function.

create_str_helper() is using va_copy() without va_end(). Add the missing
call.

[1] https://linux.die.net/man/3/va_copy

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
This commit is contained in:
Nicolas Iooss 2018-05-26 18:26:49 +02:00
parent daa00b2899
commit a761a88aab
No known key found for this signature in database
GPG key ID: C191415F340DAAA0

View file

@ -80,10 +80,13 @@ static char *create_str_helper(const char *fmt, int num, va_list vargs)
goto exit;
}
va_end(vargs2);
return str;
exit:
free(str);
va_end(vargs2);
return NULL;
}