Storage API: add safety check for cases when there is no storage used.

pull/466/head
Victor Julien 13 years ago
parent caf730d988
commit f06694d0c1

@ -52,6 +52,7 @@ void FlowFreeStorageById(Flow *f, int id) {
}
void FlowFreeStorage(Flow *f) {
if (FlowStorageSize() > 0)
StorageFreeAll((Storage *)((void *)f + sizeof(Flow)), STORAGE_FLOW);
}

@ -48,6 +48,7 @@ void HostFreeStorageById(Host *h, int id) {
}
void HostFreeStorage(Host *h) {
if (HostStorageSize() > 0)
StorageFreeAll((Storage *)((void *)h + sizeof(Host)), STORAGE_HOST);
}

Loading…
Cancel
Save