]> git.stg.codes - stg.git/commitdiff
Check NULL value pairs.
authorMaxim Mamontov <faust@stg.dp.ua>
Thu, 15 Oct 2015 14:47:04 +0000 (17:47 +0300)
committerMaxim Mamontov <faust@stg.dp.ua>
Thu, 15 Oct 2015 14:47:04 +0000 (17:47 +0300)
projects/rlm_stg/rlm_stg.c

index 506545934646fce9f9bf3df0b1531dd91d0456c1..84df4e7b7cbf683d2a44b4e0e129f2431fedf8d9 100644 (file)
@@ -57,9 +57,11 @@ static size_t toVPS(const STG_PAIR* pairs, VALUE_PAIR** vps)
 
     while (!emptyPair(pair)) {
         VALUE_PAIR* vp = pairmake(pair->key, pair->value, T_OP_SET);
-        pairadd(vps, vp);
+        if (vp != NULL) {
+            pairadd(vps, vp);
+            ++count;
+        }
         ++pair;
-        ++count;
     }
 
     return count;