Navigation


Changes in / [1152:7284e41faa46:1150:611c5691661d] in freeDiameter


Ignore:
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/app_diameap/diameap_eap.c

    r1151 r1075  
    9292        *vendor = 0;
    9393        *eaptype = TYPE_NONE;
     94        eap_sm->selectedMethod = NULL;
     95
    9496        if (eap_sm == NULL)
    9597        {
    9698                return EINVAL;
    9799        }
    98 
    99         eap_sm->selectedMethod = NULL;
    100100
    101101        if (eap_sm->user.userid == NULL)
  • extensions/app_diameap/diameap_server.c

    r1151 r1120  
    11311131static void free_ans_attrib(struct avp_attribute * ans_attrib)
    11321132{
     1133        if (ans_attrib->tofree == 1)
     1134        {
     1135                if(ans_attrib->value.os.data){
     1136                free(ans_attrib->value.os.data);
     1137                ans_attrib->value.os.data = NULL;
     1138                }
     1139        }
    11331140        if(ans_attrib){
    1134                 if (ans_attrib->tofree == 1)
    1135                 {
    1136                         if(ans_attrib->value.os.data){
    1137                         free(ans_attrib->value.os.data);
    1138                         ans_attrib->value.os.data = NULL;
    1139                         }
    1140                 }
    1141                 free(ans_attrib);
    1142                 ans_attrib = NULL;
     1141        free(ans_attrib);
     1142        ans_attrib = NULL;
    11431143        }
    11441144}
     
    11851185{
    11861186
     1187        if (diameap_sm->eap_sm.user.userid != NULL)
     1188        {
     1189                free(diameap_sm->eap_sm.user.userid);
     1190                diameap_sm->eap_sm.user.userid = NULL;
     1191        }
     1192
     1193        if (diameap_sm->eap_sm.user.password != NULL)
     1194        {
     1195                free(diameap_sm->eap_sm.user.password);
     1196                diameap_sm->eap_sm.user.password = NULL;
     1197        }
     1198
     1199        diameap_sm->eap_sm.selectedMethod = NULL;
     1200
     1201        if (diameap_sm->eap_sm.methodData != NULL)
     1202        {
     1203
     1204                struct plugin * cplugin;
     1205                if (diameap_plugin_get(diameap_sm->eap_sm.currentVendor,
     1206                                diameap_sm->eap_sm.currentMethod, &cplugin))
     1207                {
     1208                        TRACE_DEBUG(INFO,"%sUnable to access EAP Method plugin {Type=%d, Vendor=%d}.",DIAMEAP_EXTENSION,diameap_sm->eap_sm.currentMethod,diameap_sm->eap_sm.currentVendor);
     1209                }
     1210
     1211                if (cplugin->eap_method_free)
     1212                {
     1213                        (*cplugin->eap_method_free)(diameap_sm->eap_sm.methodData);
     1214                        diameap_sm->eap_sm.methodData = NULL;
     1215                }
     1216                else
     1217                {
     1218                        TRACE_DEBUG(INFO,"%s[%s plugin] datafree function not available.",DIAMEAP_EXTENSION,cplugin->methodname);
     1219                        if (diameap_sm->eap_sm.methodData != NULL)
     1220                        {
     1221                                free(diameap_sm->eap_sm.methodData);
     1222                                diameap_sm->eap_sm.methodData = NULL;
     1223                        }
     1224                }
     1225                if (diameap_sm->eap_sm.methodData)
     1226                {
     1227                        TRACE_DEBUG(INFO,"%sSession state was not been freed correctly!!!",DIAMEAP_EXTENSION);
     1228                }
     1229        }
     1230
     1231        if (diameap_sm->failedavp != NULL)
     1232        {
     1233                CHECK_FCT_DO(fd_msg_free(diameap_sm->failedavp), );
     1234        }
     1235
     1236        if (diameap_sm->lastReqEAPavp != NULL)
     1237        {
     1238                CHECK_FCT_DO(fd_msg_free(diameap_sm->lastReqEAPavp), );
     1239        }
     1240
     1241        CHECK_FCT_DO(diameap_unlink_attributes_lists(diameap_sm), );
     1242
    11871243        if (diameap_sm != NULL)
    11881244        {
    1189                 if (diameap_sm->eap_sm.user.userid != NULL)
    1190                 {
    1191                         free(diameap_sm->eap_sm.user.userid);
    1192                         diameap_sm->eap_sm.user.userid = NULL;
    1193                 }
    1194 
    1195                 if (diameap_sm->eap_sm.user.password != NULL)
    1196                 {
    1197                         free(diameap_sm->eap_sm.user.password);
    1198                         diameap_sm->eap_sm.user.password = NULL;
    1199                 }
    1200 
    1201                 diameap_sm->eap_sm.selectedMethod = NULL;
    1202 
    1203                 if (diameap_sm->eap_sm.methodData != NULL)
    1204                 {
    1205 
    1206                         struct plugin * cplugin;
    1207                         if (diameap_plugin_get(diameap_sm->eap_sm.currentVendor,
    1208                                         diameap_sm->eap_sm.currentMethod, &cplugin))
    1209                         {
    1210                                 TRACE_DEBUG(INFO,"%sUnable to access EAP Method plugin {Type=%d, Vendor=%d}.",DIAMEAP_EXTENSION,diameap_sm->eap_sm.currentMethod,diameap_sm->eap_sm.currentVendor);
    1211                         }
    1212 
    1213                         if (cplugin->eap_method_free)
    1214                         {
    1215                                 (*cplugin->eap_method_free)(diameap_sm->eap_sm.methodData);
    1216                                 diameap_sm->eap_sm.methodData = NULL;
    1217                         }
    1218                         else
    1219                         {
    1220                                 TRACE_DEBUG(INFO,"%s[%s plugin] datafree function not available.",DIAMEAP_EXTENSION,cplugin->methodname);
    1221                                 if (diameap_sm->eap_sm.methodData != NULL)
    1222                                 {
    1223                                         free(diameap_sm->eap_sm.methodData);
    1224                                         diameap_sm->eap_sm.methodData = NULL;
    1225                                 }
    1226                         }
    1227                         if (diameap_sm->eap_sm.methodData)
    1228                         {
    1229                                 TRACE_DEBUG(INFO,"%sSession state was not been freed correctly!!!",DIAMEAP_EXTENSION);
    1230                         }
    1231                 }
    1232 
    1233                 if (diameap_sm->failedavp != NULL)
    1234                 {
    1235                         CHECK_FCT_DO(fd_msg_free(diameap_sm->failedavp), );
    1236                 }
    1237 
    1238                 if (diameap_sm->lastReqEAPavp != NULL)
    1239                 {
    1240                         CHECK_FCT_DO(fd_msg_free(diameap_sm->lastReqEAPavp), );
    1241                 }
    1242 
    1243                 CHECK_FCT_DO(diameap_unlink_attributes_lists(diameap_sm), );
    1244 
    12451245                free(diameap_sm);
    12461246                diameap_sm = NULL;
  • extensions/app_diameap/diameap_tls.c

    r1151 r874  
    396396        */
    397397        fprintf(stderr, "-------------End Dump EAP-TLS msg-------------\n");
    398        
    399         free(data);
    400398}
    401399
  • libfdproto/dispatch.c

    r1151 r1127  
    123123        struct fd_list * cb_list = NULL;
    124124        struct disp_hdl * new;
    125         struct dict_object * type_enum = NULL, * type_avp;
     125        struct dict_object * type_enum, * type_avp;
    126126        struct dictionary  * dict = NULL;
    127127       
     
    150150                        if (dict) {
    151151                                CHECK_FCT( fd_dict_search(dict, DICT_TYPE, TYPE_OF_AVP, when->avp, &type_avp, EINVAL) );
    152                                 if (type_enum) {
    153                                         CHECK_PARAMS( type_enum == type_avp );
    154                                 }
     152                                CHECK_PARAMS( type_enum == type_avp );
    155153                        }
    156154                        break;
Note: See TracChangeset for help on using the changeset viewer.