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:
commit
72959fc216
1 changed files with 6 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue