From 1f019ceea1ed39286e6bccfb3ff936c22fe0f7c0 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 21 Jun 2016 17:19:10 +0200 Subject: Fix various memory management issues Consistently handle allocation failures. Some functions are changed to return bool or int instead of void to allow returning an error. Also fix a buffer size miscalculation in lua/uloop and use _exit() instead of exit() on errors after forking. Signed-off-by: Matthias Schiffer --- kvlist.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kvlist.h') diff --git a/kvlist.h b/kvlist.h index 0d35b46..d59ff9e 100644 --- a/kvlist.h +++ b/kvlist.h @@ -45,7 +45,7 @@ struct kvlist_node { void kvlist_init(struct kvlist *kv, int (*get_len)(struct kvlist *kv, const void *data)); void kvlist_free(struct kvlist *kv); void *kvlist_get(struct kvlist *kv, const char *name); -void kvlist_set(struct kvlist *kv, const char *name, const void *data); +bool kvlist_set(struct kvlist *kv, const char *name, const void *data); bool kvlist_delete(struct kvlist *kv, const char *name); int kvlist_strlen(struct kvlist *kv, const void *data); -- cgit v1.2.3