From 1b87d473532c148b6df23e05e3e1be52455a98b9 Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Wed, 25 Mar 2015 00:20:18 +0200 Subject: [PATCH] Update chck --- bin/server.c | 2 +- lib/chck | 2 +- src/pi9_string.c | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/server.c b/bin/server.c index 7fbc670..544cd83 100644 --- a/bin/server.c +++ b/bin/server.c @@ -106,7 +106,7 @@ unlink_childs(struct fs *fs, struct node *parent) chck_iter_pool_for_each(&parent->childs, c) unlink_nodes(parent, get_node(fs, *c)); - chck_iter_pool_release(&parent->childs); + chck_iter_pool_flush(&parent->childs); } static bool diff --git a/lib/chck b/lib/chck index 7ab4f4d..72dc466 160000 --- a/lib/chck +++ b/lib/chck @@ -1 +1 @@ -Subproject commit 7ab4f4d3c6fdb6cff15134bc261a73d1eb32877d +Subproject commit 72dc4664a5e695e53e4af48fff3a36db0f67c0e2 diff --git a/src/pi9_string.c b/src/pi9_string.c index ec6446f..6b0ba7c 100644 --- a/src/pi9_string.c +++ b/src/pi9_string.c @@ -3,13 +3,15 @@ #include #include #include +#include #include "pi9_string.h" static inline char* ccopy(const char *str, size_t len) { - char *cpy = calloc(1, len + 1); + assert(str); + char *cpy = chck_calloc_add_of(len, 1); return (cpy ? memcpy(cpy, str, len) : NULL); } @@ -56,7 +58,7 @@ pi9_string_set_varg(struct pi9_string *string, const char *fmt, va_list args) char *str = NULL; const size_t len = vsnprintf(NULL, 0, fmt, args); - if (len > 0 && !(str = malloc(len + 1))) + if (len > 0 && !(str = chck_malloc_add_of(len, 1))) return false; vsnprintf(str, len + 1, fmt, cpy);