fallback to paircreate() if dictionary lookup fails
authorLuke Howard <lukeh@padl.com>
Thu, 10 Mar 2011 06:34:04 +0000 (17:34 +1100)
committerLuke Howard <lukeh@padl.com>
Thu, 10 Mar 2011 06:34:04 +0000 (17:34 +1100)
util_radius.cpp

index fb62c43..51958aa 100644 (file)
@@ -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;