Implement util_free_var function

This commit is contained in:
MrDave
2021-03-22 20:34:36 -06:00
committed by Mr-Dave
parent f10484f174
commit e0f2011d69
14 changed files with 98 additions and 205 deletions

View File

@@ -652,8 +652,7 @@ static void event_movie_newfile(struct ctx_cam *cam, motion_event evnt
if (retcd < 0) {
MOTION_LOG(ERR, TYPE_EVENTS, NO_ERRNO
,_("Error opening ctx_cam for movie output."));
free(cam->movie_norm);
cam->movie_norm=NULL;
util_free_var(cam->movie_norm);
return;
}
event(cam, EVENT_FILECREATE, NULL, cam->movie_norm->filename, (void *)FTYPE_MPEG, ts1);
@@ -664,8 +663,7 @@ static void event_movie_newfile(struct ctx_cam *cam, motion_event evnt
if (retcd < 0) {
MOTION_LOG(ERR, TYPE_EVENTS, NO_ERRNO
,_("Error creating motion file [%s]"), cam->movie_motion->filename);
free(cam->movie_motion);
cam->movie_motion = NULL;
util_free_var(cam->movie_motion);
return;
}
}
@@ -686,8 +684,7 @@ static void event_movie_timelapse(struct ctx_cam *cam, motion_event evnt
if (retcd < 0) {
MOTION_LOG(ERR, TYPE_EVENTS, NO_ERRNO
,_("Error creating timelapse file [%s]"), cam->movie_timelapse->filename);
free(cam->movie_timelapse);
cam->movie_timelapse = NULL;
util_free_var(cam->movie_timelapse);
return;
}
event(cam, EVENT_FILECREATE, NULL, cam->movie_timelapse->filename
@@ -731,15 +728,13 @@ static void event_movie_closefile(struct ctx_cam *cam, motion_event evnt
if (cam->movie_norm) {
movie_close(cam->movie_norm);
free(cam->movie_norm);
cam->movie_norm = NULL;
util_free_var(cam->movie_norm);
event(cam, EVENT_FILECLOSE, NULL, cam->newfilename, (void *)FTYPE_MPEG, ts1);
}
if (cam->movie_motion) {
movie_close(cam->movie_motion);
free(cam->movie_motion);
cam->movie_motion = NULL;
util_free_var(cam->movie_motion);
event(cam, EVENT_FILECLOSE, NULL, cam->motionfilename, (void *)FTYPE_MPEG_MOTION, ts1);
}
@@ -756,8 +751,7 @@ static void event_movie_timelapseend(struct ctx_cam *cam, motion_event evnt
if (cam->movie_timelapse) {
movie_close(cam->movie_timelapse);
free(cam->movie_timelapse);
cam->movie_timelapse = NULL;
util_free_var(cam->movie_timelapse);
event(cam, EVENT_FILECLOSE, NULL, cam->timelapsefilename, (void *)FTYPE_MPEG_TIMELAPSE, ts1);
}
}