diff options
author | ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2008-12-15 00:31:04 (EST) |
---|---|---|
committer | ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2008-12-15 00:31:04 (EST) |
commit | 5795b0541bbdb1ac596c969ec106c5323d0404f7 (patch) | |
tree | 95c62bbbe75a96d19265554106e486e53e3a75b1 | |
parent | 1fbbf92702edaa05d779cc533af9ab0eb583be00 (diff) |
opkg: using calloc to replace the malloc, initialize varaiable
git-svn-id: http://opkg.googlecode.com/svn/trunk@163 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
-rw-r--r-- | libopkg/pkg_vec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libopkg/pkg_vec.c b/libopkg/pkg_vec.c index 56e29bc..819a135 100644 --- a/libopkg/pkg_vec.c +++ b/libopkg/pkg_vec.c @@ -23,7 +23,7 @@ pkg_vec_t * pkg_vec_alloc(void) { - pkg_vec_t * vec = (pkg_vec_t *)malloc(sizeof(pkg_vec_t)); + pkg_vec_t * vec = (pkg_vec_t *)calloc(1, sizeof(pkg_vec_t)); if (!vec) { fprintf(stderr, "%s: out of memory\n", __FUNCTION__); return NULL; @@ -161,7 +161,7 @@ int pkg_vec_mark_if_matches(pkg_vec_t *vec, const char *pattern) abstract_pkg_vec_t * abstract_pkg_vec_alloc(void) { abstract_pkg_vec_t * vec ; - vec = (abstract_pkg_vec_t *)malloc(sizeof(abstract_pkg_vec_t)); + vec = (abstract_pkg_vec_t *)calloc(1, sizeof(abstract_pkg_vec_t)); if (!vec) { fprintf(stderr, "%s: out of memory\n", __FUNCTION__); return NULL; |