diff options
Diffstat (limited to 'libopkg/opkg_remove.c')
-rw-r--r-- | libopkg/opkg_remove.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libopkg/opkg_remove.c b/libopkg/opkg_remove.c index 1debf21..3edb6de 100644 --- a/libopkg/opkg_remove.c +++ b/libopkg/opkg_remove.c @@ -54,7 +54,7 @@ int pkg_has_installed_dependents(opkg_conf_t *conf, abstract_pkg_t *parent_apkg, /* if caller requested the set of installed dependents */ if (pdependents) { int p = 0; - abstract_pkg_t **dependents = (abstract_pkg_t **)malloc((n_installed_dependents+1)*sizeof(abstract_pkg_t *)); + abstract_pkg_t **dependents = (abstract_pkg_t **)calloc((n_installed_dependents+1), sizeof(abstract_pkg_t *)); if ( dependents == NULL ){ fprintf(stderr,"%s Unable to allocate memory. REPORT THIS BUG IN BUGZILLA PLEASE\n", __FUNCTION__); @@ -181,7 +181,7 @@ static int remove_autoinstalled (opkg_conf_t *conf, pkg_t *pkg) int x = 0; pkg_t *p; d_str = pkg->depends_str[i]; - buffer = malloc (strlen (d_str) + 1); + buffer = calloc (1, strlen (d_str) + 1); if (!buffer) { fprintf(stderr,"%s Unable to allocate memory.\n", __FUNCTION__); |