opkg_package_t *p;
- p = calloc (1, sizeof (opkg_package_t));
+ p = xcalloc(1, sizeof (opkg_package_t));
return p;
}
opkg_t *opkg;
int err;
- opkg = calloc (1, sizeof (opkg_t));
+ opkg = xcalloc(1, sizeof (opkg_t));
- opkg->args = calloc (1, sizeof (args_t));
- err = args_init (opkg->args);
- if (err)
- {
- free (opkg->args);
- free (opkg);
- return NULL;
- }
+ opkg->args = xcalloc(1, sizeof (args_t));
+ args_init (opkg->args);
- opkg->conf = calloc (1, sizeof (opkg_conf_t));
+ opkg->conf = xcalloc(1, sizeof (opkg_conf_t));
err = opkg_conf_init (opkg->conf, opkg->args);
if (err)
{
{
opkg_assert (opkg != NULL);
+#ifdef HAVE_CURL
+ opkg_curl_cleanup();
+#endif
opkg_conf_deinit (opkg->conf);
args_deinit (opkg->args);
free (opkg->options);
}
}
- tmp = xstrdup("/tmp/opkg.XXXXXX");
-
- if (mkdtemp (tmp) == NULL)
- {
+ sprintf_alloc(&tmp, "%s/update-XXXXXX", opkg->conf->tmp_dir);
+ if (mkdtemp (tmp) == NULL) {
/* XXX: Error: could not create temporary file name */
free (lists_dir);
free (tmp);
{
if (strstr(((pkg_src_t *)iter->data)->value, "://") &&
index(strstr(((pkg_src_t *)iter->data)->value, "://") + 3, '/'))
- stmp = strndup(((pkg_src_t *)iter->data)->value,
+ stmp = xstrndup(((pkg_src_t *)iter->data)->value,
(index(strstr(((pkg_src_t *)iter->data)->value, "://") + 3, '/') - ((pkg_src_t *)iter->data)->value)*sizeof(char));
else