Skip to content

Conversation

lnksz
Copy link

@lnksz lnksz commented Jun 7, 2019

Bug

pkg_t pkg;
pkg_init_from_file(&next, "/tmp/some.ipk"); // This calls pkg_init() under the hood
// Use pkg here
pkg_deinit(&pkg); // ==> free(pkg->tags) freeing an uninitialized pointer

This is not surfacing if one uses the pkg_new() call, as the underlaying calloc() sets this to 0, which could be NULL, so the free is ok. But as the described method is also legit by the API and spares a possible memory leak, the init should be added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant