aboutsummaryrefslogtreecommitdiff
path: root/ar.c
diff options
context:
space:
mode:
Diffstat (limited to 'ar.c')
-rw-r--r--ar.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ar.c b/ar.c
index d82763df1..241c1fac2 100644
--- a/ar.c
+++ b/ar.c
@@ -246,7 +246,7 @@ static headerL_t *getHeaders(int srcFd, headerL_t *head, int funct)
246 headerL_t *list; 246 headerL_t *list;
247 off_t initialOffset; 247 off_t initialOffset;
248 248
249 list = (headerL_t *) malloc(sizeof(headerL_t)); 249 list = (headerL_t *) xmalloc(sizeof(headerL_t));
250 initialOffset=lseek(srcFd, 0, SEEK_CUR); 250 initialOffset=lseek(srcFd, 0, SEEK_CUR);
251 if (checkArMagic(srcFd)==TRUE) 251 if (checkArMagic(srcFd)==TRUE)
252 ar=TRUE; 252 ar=TRUE;
@@ -258,7 +258,7 @@ static headerL_t *getHeaders(int srcFd, headerL_t *head, int funct)
258 if (tar==TRUE) { 258 if (tar==TRUE) {
259 while(readTarHeader(srcFd, list)==TRUE) { 259 while(readTarHeader(srcFd, list)==TRUE) {
260 off_t tarOffset; 260 off_t tarOffset;
261 list->next = (headerL_t *) malloc(sizeof(headerL_t)); 261 list->next = (headerL_t *) xmalloc(sizeof(headerL_t));
262 *list->next = *head; 262 *list->next = *head;
263 *head = *list; 263 *head = *list;
264 264
@@ -282,7 +282,7 @@ static headerL_t *getHeaders(int srcFd, headerL_t *head, int funct)
282 if (readArEntry(srcFd, list) == FALSE) 282 if (readArEntry(srcFd, list) == FALSE)
283 return(head); 283 return(head);
284 } 284 }
285 list->next = (headerL_t *) malloc(sizeof(headerL_t)); 285 list->next = (headerL_t *) xmalloc(sizeof(headerL_t));
286 *list->next = *head; 286 *list->next = *head;
287 *head = *list; 287 *head = *list;
288 /* recursive check for sub-archives */ 288 /* recursive check for sub-archives */
@@ -349,9 +349,9 @@ extern int ar_main(int argc, char **argv)
349 return (FALSE); 349 return (FALSE);
350 } 350 }
351 optind++; 351 optind++;
352 entry = (headerL_t *) malloc(sizeof(headerL_t)); 352 entry = (headerL_t *) xmalloc(sizeof(headerL_t));
353 header = (headerL_t *) malloc(sizeof(headerL_t)); 353 header = (headerL_t *) xmalloc(sizeof(headerL_t));
354 extractList = (headerL_t *) malloc(sizeof(headerL_t)); 354 extractList = (headerL_t *) xmalloc(sizeof(headerL_t));
355 355
356 header = getHeaders(srcFd, header, funct); 356 header = getHeaders(srcFd, header, funct);
357 /* find files to extract or display */ 357 /* find files to extract or display */
@@ -359,7 +359,7 @@ extern int ar_main(int argc, char **argv)
359 /* only handle specified files */ 359 /* only handle specified files */
360 while(optind < argc) { 360 while(optind < argc) {
361 if ( (entry = findEntry(header, argv[optind])) != NULL) { 361 if ( (entry = findEntry(header, argv[optind])) != NULL) {
362 entry->next = (headerL_t *) malloc(sizeof(headerL_t)); 362 entry->next = (headerL_t *) xmalloc(sizeof(headerL_t));
363 *entry->next = *extractList; 363 *entry->next = *extractList;
364 *extractList = *entry; 364 *extractList = *entry;
365 } 365 }