]> granicus.if.org Git - php/commitdiff
drop freeing of uninitialized variable
authorAntony Dovgal <tony2001@php.net>
Thu, 24 Jul 2008 14:30:58 +0000 (14:30 +0000)
committerAntony Dovgal <tony2001@php.net>
Thu, 24 Jul 2008 14:30:58 +0000 (14:30 +0000)
add missing return
nuke unused variable

ext/fileinfo/libmagic/apprentice.c
ext/fileinfo/libmagic/funcs.c

index 60e8f8b9f1e81632fd2e1064a5d0eb39806352e7..3ebab46fcb738509a422d379eaf23b9e436c30e3 100644 (file)
@@ -351,7 +351,6 @@ file_apprentice(struct magic_set *ms, const char *fn, int action)
        if (fn == NULL) {
 #ifdef PHP_BUNDLE
                if ((mlist = malloc(sizeof(*mlist))) == NULL) {
-                       free(mfn);
                        file_oomem(ms, sizeof(*mlist));
                        return NULL;
                }
@@ -583,6 +582,7 @@ set_test_type(struct magic *mstart, struct magic *m)
                /* invalid search type, but no need to complain here */
                break;
        }
+       return 1;
 }
 
 /*
index d9e84fa6dabb8dc60da03fdacc867ddef1a66581..ef3d3e7daca828e8ac3828369cb5b6802467684e 100644 (file)
@@ -48,7 +48,6 @@ protected int
 file_printf(struct magic_set *ms, const char *fmt, ...)
 {
        va_list ap;
-       size_t size;
        int len;
        char *buf, *newstr;