diff --git a/src/cache.c b/src/cache.c index f734c71..3e6cc51 100644 --- a/src/cache.c +++ b/src/cache.c @@ -785,7 +785,7 @@ Cache *Cache_open(const char *fn) Cache *cf = Cache_alloc(); /* Fill in the fs_path */ - cf->fs_path = calloc(MAX_PATH_LEN + 1, sizeof(char)); + cf->fs_path = CALLOC(MAX_PATH_LEN + 1, sizeof(char)); strncpy(cf->fs_path, fn, MAX_PATH_LEN); /* Set the path for the local cache file, if we are in sonic mode */ diff --git a/src/sonic.c b/src/sonic.c index 9d898d7..4e4168b 100644 --- a/src/sonic.c +++ b/src/sonic.c @@ -208,7 +208,7 @@ static void XMLCALL XML_parser_general(void *data, const char *elem, char *suffix = ""; for (int i = 0; attr[i]; i += 2) { if (!strcmp("id", attr[i])) { - link->sonic_id = calloc(MAX_FILENAME_LEN + 1, sizeof(char)); + link->sonic_id = CALLOC(MAX_FILENAME_LEN + 1, sizeof(char)); strncpy(link->sonic_id, attr[i+1], MAX_FILENAME_LEN); id_set = 1; continue; @@ -248,7 +248,7 @@ static void XMLCALL XML_parser_general(void *data, const char *elem, } if (!strcmp("created", attr[i])) { - struct tm *tm = calloc(1, sizeof(struct tm)); + struct tm *tm = CALLOC(1, sizeof(struct tm)); strptime(attr[i+1], "%Y-%m-%dT%H:%M:%S.000Z", tm); link->time = mktime(tm); free(tm); @@ -404,7 +404,7 @@ static void XMLCALL XML_parser_id3_root(void *data, const char *elem, } if (!strcmp("id", attr[i])) { - link->sonic_id = calloc(MAX_FILENAME_LEN + 1, sizeof(char)); + link->sonic_id = CALLOC(MAX_FILENAME_LEN + 1, sizeof(char)); strncpy(link->sonic_id, attr[i+1], MAX_FILENAME_LEN); id_set = 1; continue;