diff options
Diffstat (limited to 'prism/diagnostic.c')
-rw-r--r-- | prism/diagnostic.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/prism/diagnostic.c b/prism/diagnostic.c index dc0836d67e..09ac9ee330 100644 --- a/prism/diagnostic.c +++ b/prism/diagnostic.c @@ -336,7 +336,7 @@ pm_diagnostic_level(pm_diagnostic_id_t diag_id) { */ bool pm_diagnostic_list_append(pm_list_t *list, const uint8_t *start, const uint8_t *end, pm_diagnostic_id_t diag_id) { - pm_diagnostic_t *diagnostic = (pm_diagnostic_t *) calloc(sizeof(pm_diagnostic_t), 1); + pm_diagnostic_t *diagnostic = (pm_diagnostic_t *) xcalloc(sizeof(pm_diagnostic_t), 1); if (diagnostic == NULL) return false; *diagnostic = (pm_diagnostic_t) { @@ -367,15 +367,15 @@ pm_diagnostic_list_append_format(pm_list_t *list, const uint8_t *start, const ui return false; } - pm_diagnostic_t *diagnostic = (pm_diagnostic_t *) calloc(sizeof(pm_diagnostic_t), 1); + pm_diagnostic_t *diagnostic = (pm_diagnostic_t *) xcalloc(sizeof(pm_diagnostic_t), 1); if (diagnostic == NULL) { return false; } size_t length = (size_t) (result + 1); - char *message = (char *) malloc(length); + char *message = (char *) xmalloc(length); if (message == NULL) { - free(diagnostic); + xfree(diagnostic); return false; } @@ -404,8 +404,8 @@ pm_diagnostic_list_free(pm_list_t *list) { while (node != NULL) { pm_diagnostic_t *next = (pm_diagnostic_t *) node->node.next; - if (node->owned) free((void *) node->message); - free(node); + if (node->owned) xfree((void *) node->message); + xfree(node); node = next; } |