summaryrefslogtreecommitdiffstats
path: root/libopkg/opkg_conf.c
diff options
context:
space:
mode:
Diffstat (limited to 'libopkg/opkg_conf.c')
-rw-r--r--libopkg/opkg_conf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libopkg/opkg_conf.c b/libopkg/opkg_conf.c
index 99db505..c29e4c2 100644
--- a/libopkg/opkg_conf.c
+++ b/libopkg/opkg_conf.c
@@ -73,7 +73,7 @@ int opkg_init_options_array(const opkg_conf_t *conf, opkg_option_t **options)
{ NULL }
};
- *options = (opkg_option_t *)malloc(sizeof(tmp));
+ *options = (opkg_option_t *)calloc(1, sizeof(tmp));
if ( options == NULL ){
fprintf(stderr,"%s: Unable to allocate memory\n",__FUNCTION__);
return -1;
@@ -182,7 +182,7 @@ int opkg_conf_init(opkg_conf_t *conf, const args_t *args)
lists_dir = tmp;
}
- pending_dir = malloc(strlen(lists_dir)+strlen("/pending")+5);
+ pending_dir = calloc(1, strlen(lists_dir)+strlen("/pending")+5);
snprintf(pending_dir,strlen(lists_dir)+strlen("/pending") ,"%s%s",lists_dir,"/pending");
conf->lists_dir = strdup(lists_dir);