diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2016-06-21 18:19:10 +0300 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2016-06-26 13:53:51 +0300 |
commit | 1f019ceea1ed39286e6bccfb3ff936c22fe0f7c0 (patch) | |
tree | 92ec3e71ca90b1bb12ff930ac1b7abfa8c1d0e07 /kvlist.h | |
parent | c2f2c47f3e9a2d709ec82a79f6fadd3124c18781 (diff) |
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 <mschiffer@universe-factory.net>
Diffstat (limited to 'kvlist.h')
-rw-r--r-- | kvlist.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |