]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Add missing sctrdup test
authorEric Leblond <eric@regit.org>
Mon, 24 Sep 2012 11:02:30 +0000 (13:02 +0200)
committerEric Leblond <eric@regit.org>
Tue, 25 Sep 2012 14:24:40 +0000 (16:24 +0200)
src/util-magic.c

index f018882166995ae4fdec8bc594aa70bfda2533d9..3fb893ff493baf5d395fc9fef0fa409daecea27a 100644 (file)
@@ -104,6 +104,9 @@ char *MagicLookup(uint8_t *buf, uint32_t buflen) {
         result = magic_buffer(g_magic_ctx, (void *)buf, (size_t)buflen);
         if (result != NULL) {
             magic = SCStrdup(result);
+            if (magic == NULL) {
+                SCLogError(SC_ERR_MEM_ALLOC, "Unable to dup magic");
+            }
         }
     }