Made nvr_close() no longer attempt to free a NULL NVR pointer.

This commit is contained in:
OBattler
2021-04-04 18:04:39 +02:00
parent 39f98cd063
commit 5ebb6caf3f

View File

@@ -1010,13 +1010,15 @@ nvr_at_close(void *priv)
timer_disable(&local->update_timer); timer_disable(&local->update_timer);
timer_disable(&nvr->onesec_time); timer_disable(&nvr->onesec_time);
if (nvr->fn != NULL) if (nvr != NULL) {
free(nvr->fn); if (nvr->fn != NULL)
free(nvr->fn);
if (nvr->data != NULL) if (nvr->data != NULL)
free(nvr->data); free(nvr->data);
free(nvr); free(nvr);
}
if (nvr_at_inited == 1) if (nvr_at_inited == 1)
nvr_at_inited = 0; nvr_at_inited = 0;