| 62 | } |
| 63 | |
| 64 | void * |
| 65 | pg_realloc(void *ptr, size_t size) |
| 66 | { |
| 67 | void *tmp; |
| 68 | |
| 69 | /* Avoid unportable behavior of realloc(NULL, 0) */ |
| 70 | if (ptr == NULL && size == 0) |
| 71 | size = 1; |
| 72 | tmp = realloc(ptr, size); |
| 73 | if (!tmp) |
| 74 | { |
| 75 | fprintf(stderr, _("out of memory\n")); |
| 76 | exit(EXIT_FAILURE); |
| 77 | } |
| 78 | return tmp; |
| 79 | } |
| 80 | |
| 81 | /* |
| 82 | * "Safe" wrapper around strdup(). |
no outgoing calls
no test coverage detected