]> pd.if.org Git - zpackage/blobdiff - zpm-search.c
fix bugs reported by static analyzer
[zpackage] / zpm-search.c
index 290c0834c63dc76212beaeea680faf799d02f5ad..b431152e690fe8ec451ed488290ad7a93cd2afe0 100644 (file)
@@ -134,7 +134,6 @@ int find_globs(struct search_ctl *opt) {
                        default:
                                break;
                }
-               globopts = GLOB_APPEND;
                free(globstr);
        }
 
@@ -191,7 +190,7 @@ int find_lib(char *soname, struct search_ctl *opt, struct pkgloc *pkg) {
 struct pkgloc *find_package(char *pkgstr, struct search_ctl *opt) {
        char *latest = 0;
        char *installed = 0, *found = 0;
-       char *pkgfile;
+       char *pkgfile = 0;
        struct pkgloc *pkg = 0;
        int rv;
        unsigned int i;
@@ -345,12 +344,10 @@ void checklibs(struct search_ctl *opts,
                                }
                                /* shouldn't be in there already */
                                jsw_hinsert(forlibs, pkginfo.id, pkginfo.file);
-                       } 
-                       /* otherwise found == 2, so just continue */
-                       if (found) {
                                free(pkginfo.file);
                                free(pkginfo.id);
-                       }
+                       } 
+                       /* otherwise found == 2, so just continue */
                }
        }
        free(pkgid);