tar: check if allocation failed

This commit is contained in:
Hiltjo Posthuma 2021-07-17 21:04:04 +02:00 committed by Michael Forney
parent 3d8481f01d
commit 61be841f5c

4
tar.c
View File

@ -78,8 +78,8 @@ static const char *filtertools[] = {
static void
pushdirtime(char *name, time_t mtime)
{
dirtimes = reallocarray(dirtimes, dirtimeslen + 1, sizeof(*dirtimes));
dirtimes[dirtimeslen].name = strdup(name);
dirtimes = ereallocarray(dirtimes, dirtimeslen + 1, sizeof(*dirtimes));
dirtimes[dirtimeslen].name = estrdup(name);
dirtimes[dirtimeslen].mtime = mtime;
dirtimeslen++;
}