aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--classify/intproto.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/classify/intproto.cpp b/classify/intproto.cpp
index 55c950f..6a233a2 100644
--- a/classify/intproto.cpp
+++ b/classify/intproto.cpp
@@ -836,15 +836,16 @@ INT_CLASS NewIntClass(int MaxNumProtos, int MaxNumConfigs) {
/*-------------------------------------------------------------------------*/
void free_int_class(INT_CLASS int_class) {
- int i;
-
- for (i = 0; i < NumProtoSetsIn (int_class); i++) {
- Efree (ProtoSetIn (int_class, i));
- }
- if (int_class->ProtoLengths != NULL) {
- Efree (int_class->ProtoLengths);
+ if (int_class) {
+ int i;
+ for (i = 0; i < NumProtoSetsIn (int_class); i++) {
+ Efree (ProtoSetIn (int_class, i));
+ }
+ if (int_class->ProtoLengths != NULL) {
+ Efree (int_class->ProtoLengths);
+ }
+ Efree(int_class);
}
- Efree(int_class);
}