Message ID | 69f0a5dd-cd31-48c3-a633-9d26ab93714f@knaff.lu (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | AT&T Unix PC : 15-realloc-null | expand |
diff -X ../exclude.txt -urN dash-0.5.12+14-broken-wait-h/src/memalloc.c dash-0.5.12+15-realloc-null/src/memalloc.c --- dash-0.5.12+14-broken-wait-h/src/memalloc.c 2024-10-27 20:32:54.604833876 +0000 +++ dash-0.5.12+15-realloc-null/src/memalloc.c 2024-10-27 20:32:44.700597405 +0000 @@ -68,7 +68,10 @@ pointer ckrealloc(pointer p, size_t nbytes) { - p = realloc(p, nbytes); + if(p == NULL) + p = malloc(nbytes); + else + p = realloc(p, nbytes); if (p == NULL) sh_error("Out of space"); return p;