]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
mem: fix shadow declaration warning 3963/head
authorVictor Julien <victor@inliniac.net>
Fri, 21 Jun 2019 11:14:21 +0000 (13:14 +0200)
committerVictor Julien <victor@inliniac.net>
Fri, 21 Jun 2019 11:14:25 +0000 (13:14 +0200)
Avoid clash by adding a leading underscore to the declaration in the
macro. These temporary vars should never clash with valid variables
from the code where they are called from.

src/util-mem.h

index 3a49cec46d9b1a2cb22fdda059e4b79d181435ce..d90c7c6bfce97d0950865ca1f609c0a910d733b8 100644 (file)
@@ -269,8 +269,8 @@ SC_ATOMIC_EXTERN(unsigned int, engine_stage);
 #define SCMallocAligned(a, b) ({ \
     void *ptrmem = NULL; \
     \
-    int r = posix_memalign(&ptrmem, (b), (a)); \
-    if (r != 0 || ptrmem == NULL) { \
+    int _r = posix_memalign(&ptrmem, (b), (a)); \
+    if (_r != 0 || ptrmem == NULL) { \
         if (ptrmem != NULL) { \
             free(ptrmem); \
             ptrmem = NULL; \