opkg: fix error message reporting caused by an uninitialized variable
[openwrt-10.03/.git] / package / opkg / patches / 005-uninitialized_err.patch
1 --- a/libopkg/pkg_hash.c
2 +++ b/libopkg/pkg_hash.c
3 @@ -367,8 +367,11 @@ pkg_t *pkg_hash_fetch_best_installation_
4       abstract_pkg_t *apkg = NULL;
5       pkg_t *ret;
6  
7 -     if (!(apkg = abstract_pkg_fetch_by_name(hash, name)))
8 -         return NULL;
9 +     if (!(apkg = abstract_pkg_fetch_by_name(hash, name))) {
10 +       if (err)
11 +         *err = 0;
12 +       return NULL;
13 +     }
14  
15       ret = pkg_hash_fetch_best_installation_candidate(conf, apkg, pkg_name_constraint_fcn, apkg->name, 0, err);
16