Navigation


Changeset 1230:e72c9dad62ac in freeDiameter for libfdproto


Ignore:
Timestamp:
Jul 21, 2013, 6:57:39 PM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

Fix issue with generating Failed-AVP when the error is DIAMETER_MISSING_AVP. Also fix a memory leak in that case

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfdproto/messages.c

    r1229 r1230  
    23712371        CHECK_FCT_DO( fd_dict_getval(model_avp, &avp_info), return NULL );
    23722372       
     2373        /* Set an initial size */
     2374        avp->avp_public.avp_len = GETAVPHDRSZ( avp->avp_public.avp_flags ) + avp_value_sizes[avp_info.avp_basetype];
     2375       
    23732376        /* Prepare the empty value */
    23742377        memset(&val, 0, sizeof(val));
     
    23772380                        val.os.data = os;
    23782381                        val.os.len  = sizeof(os);
     2382                        avp->avp_public.avp_len += val.os.len;
    23792383                case AVP_TYPE_INTEGER32:
    23802384                case AVP_TYPE_INTEGER64:
     
    24402444                        pr_data->pei->pei_errcode = "DIAMETER_MISSING_AVP";
    24412445                        pr_data->pei->pei_avp = empty_avp(rule->rule_avp);
     2446                        pr_data->pei->pei_avp_free = 1;
    24422447                }
    24432448                return EBADMSG;
     
    24532458                                pr_data->pei->pei_errcode = "DIAMETER_AVP_OCCURS_TOO_MANY_TIMES";
    24542459                        pr_data->pei->pei_avp = empty_avp(rule->rule_avp); /* Well we are supposed to return the (max + 1)th instance of the AVP instead... Pfff... */ TODO("Improve...");
     2460                        pr_data->pei->pei_avp_free = 1;
    24552461                }
    24562462                return EBADMSG;
     
    24722478                                        pr_data->pei->pei_message = "AVP was not in its fixed position";
    24732479                                        pr_data->pei->pei_avp = empty_avp(rule->rule_avp);
     2480                                        pr_data->pei->pei_avp_free = 1;
    24742481                                }
    24752482                                return EBADMSG;
     
    24852492                                        pr_data->pei->pei_message = "AVP was not in its fixed position";
    24862493                                        pr_data->pei->pei_avp = empty_avp(rule->rule_avp);
     2494                                        pr_data->pei->pei_avp_free = 1;
    24872495                                }
    24882496                                return EBADMSG;
Note: See TracChangeset for help on using the changeset viewer.