소스 검색

Replace the dummy-use var in SMARTLIST_FOREACH_END() with one that is less likely to confuse analysis tools into thinking we do use after free. Arguably, (void)x should count as use in suppressing unused variable warnings, but not in generating hey-you-used-a-variable warnings. Arguably, though, it shouldn't.

svn:r16815
Nick Mathewson 17 년 전
부모
커밋
6c432a5565
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/common/container.h

+ 1 - 1
src/common/container.h

@@ -204,7 +204,7 @@ char *smartlist_join_strings2(smartlist_t *sl, const char *join,
       var = (sl)->list[var ## _sl_idx];
 
 #define SMARTLIST_FOREACH_END(var)              \
-    (void)var;                                  \
+    var = NULL;                                 \
   } STMT_END
 
 #define SMARTLIST_FOREACH(sl, type, var, cmd)                   \