]> arthur.barton.de Git - netatalk.git/commitdiff
afpd/hash: avoid use after free in main in case of OOM
authorRiccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
Fri, 1 Feb 2013 18:22:17 +0000 (19:22 +0100)
committerRiccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
Sat, 9 Feb 2013 09:20:27 +0000 (10:20 +0100)
Reported by Coverity as CID #968574, #968575.

etc/afpd/hash.c

index 4861e8112589a7ffb8af67cd4ede9ad741067fb2..d88cb0c28767cd2706dfd93d6d00ccee460a1ae1 100644 (file)
@@ -1012,6 +1012,7 @@ int main(void)
                 puts("out of memory");
                 free((void *) key);
                 free(val);
+                break;
             }
 
             if (!hash_alloc_insert(h, key, val)) {