[njs] Fixed building with GCC ASan.

Valentin Bartenev vbart at nginx.com
Thu Nov 10 12:33:22 UTC 2016


details:   http://hg.nginx.org/njs/rev/d8b1e2576409
branches:  
changeset: 246:d8b1e2576409
user:      Valentin Bartenev <vbart at nginx.com>
date:      Thu Nov 10 15:33:02 2016 +0300
description:
Fixed building with GCC ASan.

diffstat:

 nxt/auto/memalign |  9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diffs (27 lines):

diff -r 7a42d1e83ae2 -r d8b1e2576409 nxt/auto/memalign
--- a/nxt/auto/memalign	Wed Nov 09 15:04:40 2016 +0300
+++ b/nxt/auto/memalign	Thu Nov 10 15:33:02 2016 +0300
@@ -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



More information about the nginx-devel mailing list