Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/common/clib-package.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,8 @@ static inline int install_packages(list_t *list, const char *dir, int verbose) {
loop_cleanup:
if (slug)
free(slug);
if (error && pkg)
clib_package_free(pkg);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add this to the existing if (error) block:

if (error) {
  if (pkg) {
    clib_package_free(pkg);
    pkg = NULL;
  }
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix

if (error) {
list_iterator_destroy(iterator);
iterator = NULL;
Expand Down Expand Up @@ -682,6 +684,10 @@ clib_package_new_from_slug_with_package_name(const char *slug, int verbose,
json = res->data;
_debug("status: %d", res->status);
if (!res || !res->ok) {
if (res) {
http_get_free(res);
res = NULL;
}
goto download;
}
log = "fetch";
Expand Down
Loading