Changeset 1151:100a0925f809 in freeDiameter for extensions
- Timestamp:
- May 22, 2013, 10:37:48 PM (11 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- extensions/app_diameap
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/app_diameap/diameap_eap.c
r1075 r1151 92 92 *vendor = 0; 93 93 *eaptype = TYPE_NONE; 94 if (eap_sm == NULL) 95 { 96 return EINVAL; 97 } 98 94 99 eap_sm->selectedMethod = NULL; 95 96 if (eap_sm == NULL)97 {98 return EINVAL;99 }100 100 101 101 if (eap_sm->user.userid == NULL) -
extensions/app_diameap/diameap_server.c
r1120 r1151 1131 1131 static void free_ans_attrib(struct avp_attribute * ans_attrib) 1132 1132 { 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 }1140 1133 if(ans_attrib){ 1141 free(ans_attrib); 1142 ans_attrib = NULL; 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; 1143 1143 } 1144 1144 } … … 1185 1185 { 1186 1186 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); 1187 if (diameap_sm != NULL) 1188 { 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); 1222 1216 diameap_sm->eap_sm.methodData = NULL; 1223 1217 } 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 1243 if (diameap_sm != NULL) 1244 { 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 1245 1245 free(diameap_sm); 1246 1246 diameap_sm = NULL; -
extensions/app_diameap/diameap_tls.c
r874 r1151 396 396 */ 397 397 fprintf(stderr, "-------------End Dump EAP-TLS msg-------------\n"); 398 399 free(data); 398 400 } 399 401
Note: See TracChangeset
for help on using the changeset viewer.