From 5795b0541bbdb1ac596c969ec106c5323d0404f7 Mon Sep 17 00:00:00 2001 From: ticktock35 Date: Mon, 15 Dec 2008 00:31:04 -0500 Subject: opkg: using calloc to replace the malloc, initialize varaiable git-svn-id: http://opkg.googlecode.com/svn/trunk@163 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358 --- 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; -- cgit v0.9.1