X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=show-files.c;h=afeb6356730e404320351022c29b6335bf366007;hb=d15aa4309cadae5c998c9ce1c45b7a104f3d80f5;hp=b53ab1053e1acf7e2a1e9c97a4d87b76e8ee238e;hpb=bb233d690a9782e1570dc93ead2bf04aaca7cfe4;p=git.git diff --git a/show-files.c b/show-files.c index b53ab105..afeb6356 100644 --- a/show-files.c +++ b/show-files.c @@ -30,9 +30,9 @@ static void add_name(const char *pathname, int len) if (nr_dir == dir_alloc) { dir_alloc = alloc_nr(dir_alloc); - dir = realloc(dir, dir_alloc*sizeof(char *)); + dir = xrealloc(dir, dir_alloc*sizeof(char *)); } - name = malloc(len + 1); + name = xmalloc(len + 1); memcpy(name, pathname, len + 1); dir[nr_dir++] = name; }