summaryrefslogtreecommitdiffstats
path: root/libopkg/nv_pair_list.c
diff options
context:
space:
mode:
authorticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2008-12-15 00:30:29 (EST)
committer ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2008-12-15 00:30:29 (EST)
commit733d8409723a397b4ced39ea7aaab8bc8b4af5d9 (patch)
tree7138fbfc11577cf7d0fbae0ae7fa98a02ef63a8e /libopkg/nv_pair_list.c
parent1cefade73444d4670d9ae7c06e8f9cc55492fd79 (diff)
opkg: adding the hash_table_remove API, not using yet.
Just complete the API for future usage. Clean all the entry at initial time. This reduces planty of unnecessary check. In order to prevent this kind of bug, using calloc to replace most malloc git-svn-id: http://opkg.googlecode.com/svn/trunk@160 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libopkg/nv_pair_list.c')
-rw-r--r--libopkg/nv_pair_list.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libopkg/nv_pair_list.c b/libopkg/nv_pair_list.c
index a3010e2..544d1e0 100644
--- a/libopkg/nv_pair_list.c
+++ b/libopkg/nv_pair_list.c
@@ -57,7 +57,7 @@ nv_pair_t *nv_pair_list_append(nv_pair_list_t *list, const char *name, const cha
int err;
/* freed in nv_pair_list_deinit */
- nv_pair_t *nv_pair = malloc(sizeof(nv_pair_t));
+ nv_pair_t *nv_pair = calloc(1, sizeof(nv_pair_t));
if (nv_pair == NULL) {
fprintf(stderr, "%s: out of memory\n", __FUNCTION__);