Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gst-plugins-base
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
George Kiagiadakis
gst-plugins-base
Commits
3f68f522
Commit
3f68f522
authored
May 09, 2014
by
Tim-Philipp Müller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tag: xmp: fix leaks in error code paths
CID 1212133
parent
446f9bf6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
gst-libs/gst/tag/gstxmptag.c
gst-libs/gst/tag/gstxmptag.c
+10
-5
No files found.
gst-libs/gst/tag/gstxmptag.c
View file @
3f68f522
...
...
@@ -1181,7 +1181,7 @@ gst_tag_list_from_xmp_buffer (GstBuffer * buffer)
gchar
*
xps
,
*
xp1
,
*
xp2
,
*
xpe
,
*
ns
,
*
ne
;
gsize
len
,
max_ft_len
;
gboolean
in_tag
;
gchar
*
part
,
*
pp
;
gchar
*
part
=
NULL
,
*
pp
;
guint
i
;
XmpTag
*
last_xmp_tag
=
NULL
;
GSList
*
pending_tags
=
NULL
;
...
...
@@ -1249,7 +1249,7 @@ gst_tag_list_from_xmp_buffer (GstBuffer * buffer)
while
(
*
xp1
!=
'<'
&&
xp1
<
xpe
)
xp1
++
;
/* no tag can be longer tha
t
the whole buffer */
/* no tag can be longer tha
n
the whole buffer */
part
=
g_malloc
(
xp2
-
xp1
);
list
=
gst_tag_list_new_empty
();
...
...
@@ -1477,12 +1477,15 @@ gst_tag_list_from_xmp_buffer (GstBuffer * buffer)
GST_INFO
(
"xmp packet parsed, %d entries"
,
gst_tag_list_n_tags
(
list
));
out:
/* free resources */
i
=
0
;
while
(
ns_map
[
i
].
original_ns
)
{
g_free
(
ns_map
[
i
].
gstreamer_ns
);
i
++
;
}
g_free
(
part
);
gst_buffer_unmap
(
buffer
,
&
info
);
...
...
@@ -1492,13 +1495,15 @@ gst_tag_list_from_xmp_buffer (GstBuffer * buffer)
/* Errors */
missing_header:
GST_WARNING
(
"malformed xmp packet header"
);
return
NULL
;
goto
out
;
missing_footer:
GST_WARNING
(
"malformed xmp packet footer"
);
return
NULL
;
goto
out
;
broken_xml:
GST_WARNING
(
"malformed xml tag: %s"
,
part
);
return
NULL
;
gst_tag_list_unref
(
list
);
list
=
NULL
;
goto
out
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment