]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
error: remove unused alloc error code
authorVictor Julien <vjulien@oisf.net>
Mon, 24 Oct 2022 11:08:25 +0000 (13:08 +0200)
committerVictor Julien <vjulien@oisf.net>
Tue, 20 Dec 2022 07:51:33 +0000 (08:51 +0100)
src/util-error.c
src/util-error.h
src/util-streaming-buffer.c

index a2c2b55eef1853f94e4c5af09b9563a516ec5786..65e50b411747721e0ab3cb72b59516ff60da9018 100644 (file)
@@ -46,7 +46,6 @@ const char * SCErrorToString(SCError err)
         CASE_CODE(SC_ENOMEM);
         CASE_CODE(SC_EINVAL);
 
-        CASE_CODE (SC_ERR_MEM_ALLOC);
         CASE_CODE (SC_ERR_ACTION_ORDER);
         CASE_CODE (SC_ERR_PCRE_MATCH);
         CASE_CODE (SC_ERR_PCRE_GET_SUBSTRING);
index 20f9b873c7f0b7a33204c224f7aeaad362a21093..be7a480817df963888b9fb3ef78ed821a5c00758 100644 (file)
@@ -31,7 +31,6 @@ typedef enum {
     SC_ENOMEM,
     SC_EINVAL,
 
-    SC_ERR_MEM_ALLOC,
     SC_ERR_PCRE_MATCH,
     SC_ERR_ACTION_ORDER,
     SC_ERR_PCRE_GET_SUBSTRING,
index b4bb890d91a923160c5375a5a0ba532671ec2412..f9c9c399a72d5704338e5a320bc72ac99322d323 100644 (file)
@@ -448,7 +448,7 @@ GrowToSize(StreamingBuffer *sb, uint32_t size)
     DEBUG_VALIDATE_BUG_ON(sb->buf_size > BIT_U32(30));
     if (size > BIT_U32(30)) { // 1GiB
         if (!g2s_warn_once) {
-            SCLogWarning(SC_ERR_MEM_ALLOC,
+            SCLogWarning(SC_ENOMEM,
                     "StreamingBuffer::GrowToSize() tried to alloc %u bytes, exceeds limit of %lu",
                     size, BIT_U32(30));
             g2s_warn_once = true;
@@ -495,7 +495,7 @@ static int WARN_UNUSED Grow(StreamingBuffer *sb)
     uint32_t grow = sb->buf_size * 2;
     if (grow > BIT_U32(30)) { // 1GiB
         if (!grow_warn_once) {
-            SCLogWarning(SC_ERR_MEM_ALLOC,
+            SCLogWarning(SC_ENOMEM,
                     "StreamingBuffer::Grow() tried to alloc %u bytes, exceeds limit of %lu", grow,
                     BIT_U32(30));
             grow_warn_once = true;