]> git.kaiwu.me - njs.git/commitdiff
Fixed building with GCC ASan.
authorValentin Bartenev <vbart@nginx.com>
Thu, 10 Nov 2016 12:33:02 +0000 (15:33 +0300)
committerValentin Bartenev <vbart@nginx.com>
Thu, 10 Nov 2016 12:33:02 +0000 (15:33 +0300)
nxt/auto/memalign

index 8aa59d14a0df56f68668075cdd6952b24fc9e569..aa2e8c21139449f0f5c0a3b2599c63f766b7a685 100644 (file)
@@ -18,6 +18,8 @@ nxt_feature_test="#include <stdlib.h>
 
                      if (posix_memalign(&p, 4096, 4096) != 0)
                          return 1;
+
+                     free(p);
                      return 0;
                  }"
 . ${NXT_AUTO}feature
@@ -35,8 +37,13 @@ if [ $nxt_found = no ]; then
     nxt_feature_test="#include <stdlib.h>
 
                      int main(void) {
-                         if (memalign(4096, 4096) == NULL)
+                         void  *p;
+
+                         p = memalign(4096, 4096)
+                         if (p == NULL)
                              return 1;
+
+                         free(p);
                          return 0;
                      }"
     . ${NXT_AUTO}feature