[libmm-camcorder] g_free and g_printf function fixes
[platform/core/multimedia/libmm-camcorder.git] / src / mm_camcorder_attribute.c
index a5a88e4..409aba4 100644 (file)
@@ -2955,11 +2955,8 @@ bool _mmcamcorder_commit_target_filename(MMHandleType handle, int attr_idx, cons
        }
 
        if (sc->info_video) {
-               if (sc->info_video->filename) {
-                       free(sc->info_video->filename);
-                       sc->info_video->filename = NULL;
-               }
-               sc->info_video->filename = strdup(filename);
+               SAFE_G_FREE(sc->info_video->filename);
+               sc->info_video->filename = g_strdup(filename);
                if (sc->info_video->filename == NULL) {
                        _mmcam_dbg_err("failed to strdup filename [%s]", filename);
                        return FALSE;