1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #34146 from kolyshkin/vasprintf

devmapper_wrapper.go: fix gcc warning
This commit is contained in:
Brian Goff 2017-07-18 12:46:23 -04:00 committed by GitHub
commit 72959fc216

View file

@ -15,10 +15,15 @@ static void log_cb(int level, const char *file, int line, int dm_errno_or_class,
{
char *buffer = NULL;
va_list ap;
int ret;
va_start(ap, f);
vasprintf(&buffer, f, ap);
ret = vasprintf(&buffer, f, ap);
va_end(ap);
if (ret < 0) {
// memory allocation failed -- should never happen?
return;
}
DevmapperLogCallback(level, (char *)file, line, dm_errno_or_class, buffer);
free(buffer);