[easytag] Fix string leak when reading WavPack tags
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag] Fix string leak when reading WavPack tags
- Date: Sun, 21 Dec 2014 22:39:48 +0000 (UTC)
commit da0cad5c8b08ed411c1cb356c86d2dd5a7b72f4d
Author: David King <amigadave amigadave com>
Date: Sun Dec 21 22:33:25 2014 +0000
Fix string leak when reading WavPack tags
src/tags/wavpack_tag.c | 26 ++++++++++++++++++++++----
1 files changed, 22 insertions(+), 4 deletions(-)
---
diff --git a/src/tags/wavpack_tag.c b/src/tags/wavpack_tag.c
index af335de..8f14e24 100644
--- a/src/tags/wavpack_tag.c
+++ b/src/tags/wavpack_tag.c
@@ -146,11 +146,20 @@ wavpack_tag_read_file_tag (GFile *file,
if (field2 && FileTag->disc_total == NULL)
{
- FileTag->disc_total = et_disc_number_to_string (atoi (Try_To_Validate_Utf8_String (field2)));
+ gchar *tmp;
+
+ tmp = Try_To_Validate_Utf8_String (field2);
+ FileTag->disc_total = et_disc_number_to_string (atoi (tmp));
+ g_free (tmp);
}
+
if (length > 0 && FileTag->disc_number == NULL)
{
- FileTag->disc_number = et_disc_number_to_string (atoi (Try_To_Validate_Utf8_String (field)));
+ gchar *tmp;
+
+ tmp = Try_To_Validate_Utf8_String (field);
+ FileTag->disc_number = et_disc_number_to_string (atoi (tmp));
+ g_free (tmp);
}
memset (field, '\0', MAXLEN);
@@ -180,11 +189,20 @@ wavpack_tag_read_file_tag (GFile *file,
if (field2 && FileTag->track_total == NULL)
{
- FileTag->track_total = et_track_number_to_string (atoi (Try_To_Validate_Utf8_String (field2)));
+ gchar *tmp;
+
+ tmp = Try_To_Validate_Utf8_String (field2);
+ FileTag->track_total = et_track_number_to_string (atoi (tmp));
+ g_free (tmp);
}
+
if (length > 0 && FileTag->track == NULL)
{
- FileTag->track = et_track_number_to_string (atoi (Try_To_Validate_Utf8_String (field)));
+ gchar *tmp;
+
+ tmp = Try_To_Validate_Utf8_String (field);
+ FileTag->track = et_track_number_to_string (atoi (tmp));
+ g_free (tmp);
}
memset (field, '\0', MAXLEN);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]