From: Maxim Mamontov Date: Thu, 15 Oct 2015 14:47:04 +0000 (+0300) Subject: Check NULL value pairs. X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/418ecfb85b58d140aa9c786d837b27d79d3187ce Check NULL value pairs. --- diff --git a/projects/rlm_stg/rlm_stg.c b/projects/rlm_stg/rlm_stg.c index 50654593..84df4e7b 100644 --- a/projects/rlm_stg/rlm_stg.c +++ b/projects/rlm_stg/rlm_stg.c @@ -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;