diff --git a/src/iec61850/server/model/config_file_parser.c b/src/iec61850/server/model/config_file_parser.c index 8846ea8b..657fc5ae 100644 --- a/src/iec61850/server/model/config_file_parser.c +++ b/src/iec61850/server/model/config_file_parser.c @@ -570,7 +570,8 @@ exit_error: if (DEBUG_IED_SERVER) printf("IED_SERVER: error parsing line %i (indentation level = %i)\n", currentLine, indendation); - IedModel_destroy(model); + if (model != NULL) + IedModel_destroy(model); return NULL; }