]> arthur.barton.de Git - netatalk.git/commitdiff
afpd/hash: return error if we can't allocate the hash
authorRiccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
Sat, 9 Feb 2013 11:11:19 +0000 (12:11 +0100)
committerRiccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
Sat, 9 Feb 2013 11:11:19 +0000 (12:11 +0100)
Instead of possible dereference of null.

Reported by Coverity as CID #968565.

etc/afpd/hash.c

index 4861e8112589a7ffb8af67cd4ede9ad741067fb2..f0030f92ec3c101a2fcc1f29e9b222ca0b4977f7 100644 (file)
@@ -982,8 +982,10 @@ int main(void)
         "s                      switch to non-functioning allocator\n"
         "q                      quit";
 
-    if (!h)
+    if (!h) {
         puts("hash_create failed");
+        return 1;
+    }
 
     for (;;) {
         if (prompt)