tar: check if allocation failed
This commit is contained in:
parent
3d8481f01d
commit
61be841f5c
4
tar.c
4
tar.c
@ -78,8 +78,8 @@ static const char *filtertools[] = {
|
|||||||
static void
|
static void
|
||||||
pushdirtime(char *name, time_t mtime)
|
pushdirtime(char *name, time_t mtime)
|
||||||
{
|
{
|
||||||
dirtimes = reallocarray(dirtimes, dirtimeslen + 1, sizeof(*dirtimes));
|
dirtimes = ereallocarray(dirtimes, dirtimeslen + 1, sizeof(*dirtimes));
|
||||||
dirtimes[dirtimeslen].name = strdup(name);
|
dirtimes[dirtimeslen].name = estrdup(name);
|
||||||
dirtimes[dirtimeslen].mtime = mtime;
|
dirtimes[dirtimeslen].mtime = mtime;
|
||||||
dirtimeslen++;
|
dirtimeslen++;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user