]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Move an assertion to make scan-build happy again.
authorNick Mathewson <nickm@torproject.org>
Sat, 18 Nov 2017 15:51:23 +0000 (10:51 -0500)
committerNick Mathewson <nickm@torproject.org>
Sat, 18 Nov 2017 15:51:23 +0000 (10:51 -0500)
src/or/dirvote.c

index ce82a5ef4a32bc883e2a92424bbd3ff23ab5aa9b..6b806879a9a35e012d17f3611e32c7cef4b682a9 100644 (file)
@@ -795,6 +795,9 @@ dirvote_compute_params(smartlist_t *votes, int method, int total_authorities)
   output = smartlist_new();
 
   SMARTLIST_FOREACH_BEGIN(param_list, const char *, param) {
+    /* resolve spurious clang shallow analysis null pointer errors */
+    tor_assert(param);
+
     const char *next_param;
     int ok=0;
     eq = strchr(param, '=');
@@ -807,8 +810,7 @@ dirvote_compute_params(smartlist_t *votes, int method, int total_authorities)
       next_param = NULL;
     else
       next_param = smartlist_get(param_list, param_sl_idx+1);
-    /* resolve spurious clang shallow analysis null pointer errors */
-    tor_assert(param);
+
     if (!next_param || strncmp(next_param, param, cur_param_len)) {
       /* We've reached the end of a series. */
       /* Make sure enough authorities voted on this param, unless the