static char *rootfs_type = NULL;
static int uptodate;
static char *filename = NULL;
+static void *dlh = NULL;
static int rc;
struct branch {
tmp = strstr(ver, "-rc");
if (tmp && strlen(tmp) > 3) {
*tmp = '~';
- strcpy(tmp + 1, tmp + 3);
+ memmove(tmp + 1, tmp + 3, strlen(tmp + 3) + 1);
}
}
* ustream-ssl
*/
static int init_ustream_ssl(void) {
- void *dlh;
glob_t gl;
int i;
return -ENOMEM;
avpk->name = strdup(blobmsg_name(cur));
- if (!avpk->name)
+ if (!avpk->name) {
+ free(avpk);
return -ENOMEM;
+ }
avpk->version = strdup(blobmsg_get_string(cur));
- if (!avpk->version)
+ if (!avpk->version) {
+ free(avpk->name);
+ free(avpk);
return -ENOMEM;
+ }
avpk->avl.key = avpk->name;
if (avl_insert(&pkg_tree, &avpk->avl)) {
sha256close:
fflush(f);
- fclose(f);
+ pclose(f);
sha256free:
free(cmd);
free(resstr);
if (ucl)
uclient_free(ucl);
+ if (dlh)
+ dlclose(dlh);
+
if (rc)
fprintf(stderr, "%s (%d)\n", strerror(-1 * rc), -1 * rc);