From 733d8409723a397b4ced39ea7aaab8bc8b4af5d9 Mon Sep 17 00:00:00 2001 From: ticktock35 Date: Mon, 15 Dec 2008 00:30:29 -0500 Subject: 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 --- (limited to 'libopkg/str_list.c') diff --git a/libopkg/str_list.c b/libopkg/str_list.c index d6f9209..1d21746 100644 --- a/libopkg/str_list.c +++ b/libopkg/str_list.c @@ -31,7 +31,7 @@ void str_list_elt_deinit(str_list_elt_t *elt) str_list_t *str_list_alloc() { - str_list_t *list = (str_list_t *)malloc(sizeof(str_list_t)); + str_list_t *list = (str_list_t *)calloc(1, sizeof(str_list_t)); if (list) str_list_init(list); return list; -- cgit v0.9.1