mirror of
https://github.com/Motion-Project/motion.git
synced 2026-05-18 19:45:23 -04:00
Revise free then null steps to be a single function
This commit is contained in:
@@ -694,10 +694,7 @@ static void motion_cam_delete(struct ctx_motapp *motapp)
|
||||
return;
|
||||
}
|
||||
|
||||
if (motapp->cam_list[motapp->cam_delete]->dbse != NULL) {
|
||||
free(motapp->cam_list[motapp->cam_delete]->dbse);
|
||||
motapp->cam_list[motapp->cam_delete]->dbse = NULL;
|
||||
}
|
||||
myfree(&motapp->cam_list[motapp->cam_delete]->dbse);
|
||||
|
||||
dbse_motpls_deinit(motapp->cam_list[motapp->cam_delete]);
|
||||
|
||||
@@ -722,10 +719,7 @@ static void motion_cam_delete(struct ctx_motapp *motapp)
|
||||
|
||||
/* Swap out the old list with the new */
|
||||
pthread_mutex_lock(&motapp->mutex_camlst);
|
||||
if (motapp->cam_list != NULL) {
|
||||
free(motapp->cam_list);
|
||||
motapp->cam_list = NULL;
|
||||
}
|
||||
myfree(&motapp->cam_list);
|
||||
motapp->cam_list = tmp;
|
||||
pthread_mutex_unlock(&motapp->mutex_camlst);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user