After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 754241 - [PATCH] Fix memory leaks in gexiv2-metadata-gps.cpp
[PATCH] Fix memory leaks in gexiv2-metadata-gps.cpp
Status: RESOLVED FIXED
Product: gexiv2
Classification: Other
Component: implementation
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Gexiv2 Maintainers
Gexiv2 Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-08-28 14:16 UTC by Roman Lebedev
Modified: 2016-04-30 06:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix leaks in gexiv2_metadata_get_gps_longitude() (4.04 KB, patch)
2015-08-28 14:16 UTC, Roman Lebedev
committed Details | Review
Fix leaks in gexiv2_metadata_get_gps_latitude() (3.98 KB, patch)
2015-08-28 14:17 UTC, Roman Lebedev
committed Details | Review
Fix leaks in gexiv2_metadata_get_gps_altitude() (3.03 KB, patch)
2015-08-28 14:17 UTC, Roman Lebedev
committed Details | Review

Description Roman Lebedev 2015-08-28 14:16:29 UTC
Created attachment 310187 [details] [review]
Fix leaks in gexiv2_metadata_get_gps_longitude()

I have found those accidentally while trying to look at viking, by executing it's tests with ASan-build.
Pointer returned from gexiv2_metadata_get_{exif,xmp,iptc}_tag_string functions should be g_free'd, else we've got a memory leak.
Comment 1 Roman Lebedev 2015-08-28 14:17:07 UTC
Created attachment 310188 [details] [review]
Fix leaks in gexiv2_metadata_get_gps_latitude()
Comment 2 Roman Lebedev 2015-08-28 14:17:34 UTC
Created attachment 310189 [details] [review]
Fix leaks in gexiv2_metadata_get_gps_altitude()
Comment 3 Roman Lebedev 2015-08-28 14:18:31 UTC
Those leaks + patches are for git master version - with last commit 59977b0fb1c1942b8e97fc3e4519fbf24679e23b
Comment 4 Jens Georg 2016-04-29 13:42:12 UTC
That looks a bit unelegant from a C++ PoV but I guess there's no better way with malloc data. Thanks!
Comment 5 Jens Georg 2016-04-30 06:06:31 UTC
Wow. That code does a memcopy just to check to tag existence. That might be expensive
Comment 6 Jens Georg 2016-04-30 06:18:09 UTC
Pushed with minor commit message adjustments