dnp3: fix memory leak with object containing bytearrays

pull/5627/head
Philippe Antoine 5 years ago committed by Victor Julien
parent 001350547a
commit 5749024e3f

@ -566,6 +566,13 @@ static int DNP3DecodeObjectG{{object.group}}V{{object.variation}}(const uint8_t
return 1;
error:
if (object != NULL) {
{% for field in object.fields %}
{% if field.type == "bytearray" %}
if (object->{{field.name}} != NULL) {
SCFree(object->{{field.name}});
}
{% endif %}
{% endfor %}
SCFree(object);
}

Loading…
Cancel
Save