From 30a36d5b85d08fd2e2d2dea18277883fabed0035 Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Thu, 10 Mar 2011 17:34:04 +1100 Subject: [PATCH] fallback to paircreate() if dictionary lookup fails --- util_radius.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/util_radius.cpp b/util_radius.cpp index fb62c43..51958aa 100644 --- a/util_radius.cpp +++ b/util_radius.cpp @@ -672,10 +672,11 @@ avpImport(VALUE_PAIR **pVp, remain -= 4; da = dict_attrbyvalue(attrid); - if (da == NULL) - goto fail; - - vp = pairalloc(da); + if (da != NULL) { + vp = pairalloc(da); + } else { + vp = paircreate(attrid, PW_TYPE_STRING); + } if (vp == NULL) { throw new std::bad_alloc; goto fail; -- 2.1.4