summaryrefslogtreecommitdiffabout
path: root/src/triplet.c
Unidiff
Diffstat (limited to 'src/triplet.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/triplet.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/triplet.c b/src/triplet.c
index 3083c64..9dfdf2c 100644
--- a/src/triplet.c
+++ b/src/triplet.c
@@ -60,6 +60,7 @@ hash_triplet_free (void *data)
60 for (up = tp->uploader_list; up; ) 60 for (up = tp->uploader_list; up; )
61 { 61 {
62 struct uploader_info *next = up->next; 62 struct uploader_info *next = up->next;
63 free (up->fpr);
63 free (up); 64 free (up);
64 up = next; 65 up = next;
65 } 66 }
@@ -94,7 +95,7 @@ register_file (struct file_info *finfo, const struct spool *spool)
94 grecs_alloc_die (); 95 grecs_alloc_die ();
95 } 96 }
96 97
97 key.name = xmalloc (finfo->root_len + 1); 98 key.name = grecs_malloc (finfo->root_len + 1);
98 memcpy (key.name, finfo->name, finfo->root_len); 99 memcpy (key.name, finfo->name, finfo->root_len);
99 key.name[finfo->root_len] = 0; 100 key.name[finfo->root_len] = 0;
100 101
@@ -378,7 +379,7 @@ format_file_data (struct file_triplet *trp, enum file_type type, char **pret)
378 379
379 /* Size */ 380 /* Size */
380 if (grecs_asprintf (&sptr, &slen, "%lu", (unsigned long) info->sb.st_size)) 381 if (grecs_asprintf (&sptr, &slen, "%lu", (unsigned long) info->sb.st_size))
381 xalloc_die (); 382 grecs_alloc_die ();
382 383
383 /* Figure out padding and format the buffer */ 384 /* Figure out padding and format the buffer */
384 slen = strlen (sptr); 385 slen = strlen (sptr);
@@ -391,7 +392,7 @@ format_file_data (struct file_triplet *trp, enum file_type type, char **pret)
391 modes, user_name, group_name, ugswidth - pad + slen, 392 modes, user_name, group_name, ugswidth - pad + slen,
392 sptr, 393 sptr,
393 timebuf, info->name)) 394 timebuf, info->name))
394 xalloc_die (); 395 grecs_alloc_die ();
395 free (sptr); 396 free (sptr);
396 *pret = buf; 397 *pret = buf;
397 return 0; 398 return 0;
@@ -411,7 +412,7 @@ expand_triplet_ls_full (struct metadef *def, void *data)
411 if (format_file_data (trp, file_directive, &buf[file_directive]) == 0) 412 if (format_file_data (trp, file_directive, &buf[file_directive]) == 0)
412 size += strlen (buf[file_directive]) + 1; 413 size += strlen (buf[file_directive]) + 1;
413 414
414 def->value = def->storage = xmalloc (size + 1); 415 def->value = def->storage = grecs_malloc (size + 1);
415 def->value[0] = 0; 416 def->value[0] = 0;
416 if (buf[file_dist]) 417 if (buf[file_dist])
417 { 418 {
@@ -446,7 +447,7 @@ expand_triplet_ls_upload (struct metadef *def, void *data)
446 if (format_file_data (trp, file_signature, &buf[file_signature]) == 0) 447 if (format_file_data (trp, file_signature, &buf[file_signature]) == 0)
447 size += strlen (buf[file_signature]) + 1; 448 size += strlen (buf[file_signature]) + 1;
448 449
449 def->value = def->storage = xmalloc (size + 1); 450 def->value = def->storage = grecs_malloc (size + 1);
450 def->value[0] = 0; 451 def->value[0] = 0;
451 if (buf[file_dist]) 452 if (buf[file_dist])
452 { 453 {
@@ -552,7 +553,7 @@ expand_email_user (struct metadef *def, void *data)
552 size_t size = 0; 553 size_t size = 0;
553 if (grecs_asprintf (&def->storage, &size, "\"%s\" <%s>", 554 if (grecs_asprintf (&def->storage, &size, "\"%s\" <%s>",
554 trp->uploader->realname, trp->uploader->email)) 555 trp->uploader->realname, trp->uploader->email))
555 xalloc_die (); 556 grecs_alloc_die ();
556 def->value = def->storage; 557 def->value = def->storage;
557 } 558 }
558 return def->value; 559 return def->value;
@@ -594,7 +595,7 @@ expand_check_result (struct metadef *def, void *data)
594 def->storage = NULL; 595 def->storage = NULL;
595 if (grecs_asprintf (&def->storage, &size, 596 if (grecs_asprintf (&def->storage, &size,
596 "%d", WEXITSTATUS (status))) 597 "%d", WEXITSTATUS (status)))
597 xalloc_die (); 598 grecs_alloc_die ();
598 } 599 }
599 else if (WIFSIGNALED (status)) 600 else if (WIFSIGNALED (status))
600 { 601 {
@@ -602,7 +603,7 @@ expand_check_result (struct metadef *def, void *data)
602 def->storage = NULL; 603 def->storage = NULL;
603 if (grecs_asprintf (&def->storage, &size, "SIG+%d", 604 if (grecs_asprintf (&def->storage, &size, "SIG+%d",
604 WTERMSIG (status))) 605 WTERMSIG (status)))
605 xalloc_die (); 606 grecs_alloc_die ();
606 } 607 }
607 else 608 else
608 return def->value = "[unrecognized return code]"; 609 return def->value = "[unrecognized return code]";

Return to:

Send suggestions and report system problems to the System administrator.