Merge pull request #1707 from dunst0/fix/ims_diameter_server
[sip-router] / src / modules / ims_diameter_server / avp_helper.c
index ab3974a..04e2d6d 100644 (file)
@@ -342,8 +342,17 @@ void parselist(AAAMessage *response, AAA_AVP_LIST *list, cJSON * item, int level
                avp_list_s = cdpb.AAAGroupAVPS(avp_list);
                cdpb.AAAFreeAVPList(&avp_list);
 
-               diameterserver_add_avp(response, avp_list_s.s, avp_list_s.len, cJSON_GetObjectItem(item,"avpCode")->valueint, flags,
-                 cJSON_GetObjectItem(item,"vendorId")->valueint, AVP_FREE_DATA, __FUNCTION__);
+               if(list) {
+                       diameterserver_add_avp_list(list, avp_list_s.s, avp_list_s.len,
+                                       cJSON_GetObjectItem(item, "avpCode")->valueint, flags,
+                                       cJSON_GetObjectItem(item, "vendorId")->valueint, AVP_FREE_DATA,
+                                       __FUNCTION__);
+               } else {
+                       diameterserver_add_avp(response, avp_list_s.s, avp_list_s.len,
+                                       cJSON_GetObjectItem(item, "avpCode")->valueint, flags,
+                                       cJSON_GetObjectItem(item, "vendorId")->valueint, AVP_FREE_DATA,
+                                       __FUNCTION__);
+               }
        } else if (cJSON_GetObjectItem(item,"int32")) {
                set_4bytes(x, cJSON_GetObjectItem(item,"int32")->valueint);
                if (list) {