Add free for some value 61/122161/1 accepted/tizen_common accepted/tizen_ivi accepted/tizen_mobile accepted/tizen_tv accepted/tizen_wearable accepted/tizen/common/20170330.152134 accepted/tizen/ivi/20170330.224644 accepted/tizen/mobile/20170330.224558 accepted/tizen/tv/20170330.224619 accepted/tizen/unified/20170330.224650 accepted/tizen/wearable/20170330.224637 submit/tizen/20170330.100651 tizen_4.0.m1_release
authorMinje Ahn <minje.ahn@samsung.com>
Thu, 30 Mar 2017 09:59:24 +0000 (18:59 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Thu, 30 Mar 2017 09:59:24 +0000 (18:59 +0900)
allocation in video, and audio codec value

Change-Id: Ief0e3b168e11b19c70c260ff455c659b4bf0c579
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
src/metadata_extractor.c

index 81d5660..18d23ad 100755 (executable)
@@ -1503,6 +1503,10 @@ int metadata_extractor_get_metadata(metadata_extractor_h metadata, metadata_extr
        if (is_string) {
                if ((s_value != NULL) && (strlen(s_value) > 0)) {
                        *value = strdup(s_value);
+                       /*Only use strdup in video_codec and audio_codec */
+                       if (attribute == METADATA_VIDEO_CODEC || attribute == METADATA_AUDIO_CODEC)
+                               SAFE_FREE(s_value);
+
                        if (*value == NULL) {
                                metadata_extractor_error("OUT_OF_MEMORY(0x%08x)", METADATA_EXTRACTOR_ERROR_OUT_OF_MEMORY);
                                return METADATA_EXTRACTOR_ERROR_OUT_OF_MEMORY;