Navigation


Changeset 1230:e72c9dad62ac in freeDiameter for libfdcore


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

Location:
libfdcore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libfdcore/messages.c

    r1228 r1230  
    388388                /* Set the error code */
    389389                CHECK_FCT( fd_msg_rescode_set(m, pei.pei_errcode, pei.pei_message, pei.pei_avp, 1 ) );
     390               
     391                /* free the pei AVP to avoid memory leak */
     392                if (pei.pei_avp_free) {
     393                        fd_msg_free(pei.pei_avp);
     394                }
    390395               
    391396                *msg = NULL;
  • libfdcore/p_ce.c

    r1191 r1230  
    637637        CHECK_FCT_DO( fd_out_send(cer, *recv_cnx, NULL), goto destroy );
    638638       
     639        if (error->pei_avp_free) {
     640                fd_msg_free(error->pei_avp);
     641        }
     642       
    639643        /* And now destroy this connection */
    640644destroy:
  • libfdcore/routing_dispatch.c

    r1216 r1230  
    610610                                                                        fd_hook_call(HOOK_MESSAGE_PARSING_ERROR, msgptr, NULL, error_info.pei_message ?: error_info.pei_errcode, fd_msg_pmdl_get(msgptr));
    611611                                                                        CHECK_FCT( return_error( &msgptr, error_info.pei_errcode, error_info.pei_message, error_info.pei_avp) );
     612                                                                        if (error_info.pei_avp_free) { fd_msg_free(error_info.pei_avp); }
    612613                                                                        return 0;
    613614                                                                } else {
     
    632633                                                                        fd_hook_call(HOOK_MESSAGE_PARSING_ERROR, msgptr, NULL, error_info.pei_message ?: error_info.pei_errcode, fd_msg_pmdl_get(msgptr));
    633634                                                                        CHECK_FCT( return_error( &msgptr, error_info.pei_errcode, error_info.pei_message, error_info.pei_avp) );
     635                                                                        if (error_info.pei_avp_free) { fd_msg_free(error_info.pei_avp); }
    634636                                                                        return 0;
    635637                                                                } else {
     
    656658                                                                        fd_hook_call(HOOK_MESSAGE_PARSING_ERROR, msgptr, NULL, error_info.pei_message ?: error_info.pei_errcode, fd_msg_pmdl_get(msgptr));
    657659                                                                        CHECK_FCT( return_error( &msgptr, error_info.pei_errcode, error_info.pei_message, error_info.pei_avp) );
     660                                                                        if (error_info.pei_avp_free) { fd_msg_free(error_info.pei_avp); }
    658661                                                                        return 0;
    659662                                                                } else {
     
    674677                                                                        fd_hook_call(HOOK_MESSAGE_PARSING_ERROR, msgptr, NULL, error_info.pei_message ?: error_info.pei_errcode, fd_msg_pmdl_get(msgptr));
    675678                                                                        CHECK_FCT( return_error( &msgptr, error_info.pei_errcode, error_info.pei_message, error_info.pei_avp) );
     679                                                                        if (error_info.pei_avp_free) { fd_msg_free(error_info.pei_avp); }
    676680                                                                        return 0;
    677681                                                                } else {
     
    932936                                                if (error_info.pei_errcode) {
    933937                                                        CHECK_FCT( return_error( &msgptr, error_info.pei_errcode, error_info.pei_message, error_info.pei_avp) );
     938                                                        if (error_info.pei_avp_free) { fd_msg_free(error_info.pei_avp); }
    934939                                                        return 0;
    935940                                                } else {
Note: See TracChangeset for help on using the changeset viewer.