005-uninitialized_err.patch 471 B

12345678910111213141516
  1. --- a/libopkg/pkg_hash.c
  2. +++ b/libopkg/pkg_hash.c
  3. @@ -363,8 +363,11 @@ pkg_t *pkg_hash_fetch_best_installation_
  4. abstract_pkg_t *apkg = NULL;
  5. pkg_t *ret;
  6. - if (!(apkg = abstract_pkg_fetch_by_name(hash, name)))
  7. - return NULL;
  8. + if (!(apkg = abstract_pkg_fetch_by_name(hash, name))) {
  9. + if (err)
  10. + *err = 0;
  11. + return NULL;
  12. + }
  13. ret = pkg_hash_fetch_best_installation_candidate(conf, apkg, pkg_name_constraint_fcn, apkg->name, 0, err);