summaryrefslogtreecommitdiff
path: root/legacy/eet
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2012-08-09 11:03:22 +0000
committerCedric BAIL <cedric.bail@free.fr>2012-08-09 11:03:22 +0000
commitaddf4cccd05a31cffb06427eb970f484c3dbfec6 (patch)
tree5c2054bfa7804467137275df8ccb52064a809b95 /legacy/eet
parente905f3ccd2b684b41834e7bdc916679ea5af77b1 (diff)
eet: don't copy string around.
SVN revision: 75040
Diffstat (limited to 'legacy/eet')
-rw-r--r--legacy/eet/ChangeLog4
-rw-r--r--legacy/eet/NEWS1
-rw-r--r--legacy/eet/src/lib/eet_data.c9
3 files changed, 8 insertions, 6 deletions
diff --git a/legacy/eet/ChangeLog b/legacy/eet/ChangeLog
index 0ce223a1b8..ce6ba0ec78 100644
--- a/legacy/eet/ChangeLog
+++ b/legacy/eet/ChangeLog
@@ -607,3 +607,7 @@
607 607
608 * Add code to detect overrun and underrun in eet_data_descriptor_element_add. 608 * Add code to detect overrun and underrun in eet_data_descriptor_element_add.
609 * Fix possible wrong size decoding for simple type. 609 * Fix possible wrong size decoding for simple type.
610
6112012-08-09 Cedric Bail
612
613 * Don't copy string around for nothing.
diff --git a/legacy/eet/NEWS b/legacy/eet/NEWS
index 456bd18048..4b8370c5ec 100644
--- a/legacy/eet/NEWS
+++ b/legacy/eet/NEWS
@@ -12,6 +12,7 @@ Fixes:
12 * Check that gnutls and openssl don't return below zero size during decipher. 12 * Check that gnutls and openssl don't return below zero size during decipher.
13 * Fix crash when cyphering huge amount of data. 13 * Fix crash when cyphering huge amount of data.
14 * Possible wrong size decoding of simple type. 14 * Possible wrong size decoding of simple type.
15 * Don't strdup string around for nothing.
15 16
16Eet 1.6.0 17Eet 1.6.0
17 18
diff --git a/legacy/eet/src/lib/eet_data.c b/legacy/eet/src/lib/eet_data.c
index 4093740215..0b8537cb95 100644
--- a/legacy/eet/src/lib/eet_data.c
+++ b/legacy/eet/src/lib/eet_data.c
@@ -110,7 +110,7 @@ struct _Eet_Data_Group_Type_Codec
110 110
111struct _Eet_Data_Chunk 111struct _Eet_Data_Chunk
112{ 112{
113 char *name; 113 const char *name;
114 int len; 114 int len;
115 int size; 115 int size;
116 int hash; 116 int hash;
@@ -1422,7 +1422,7 @@ eet_data_chunk_new(void *data,
1422 || type == EET_T_F8P24) 1422 || type == EET_T_F8P24)
1423 type = EET_T_DOUBLE; 1423 type = EET_T_DOUBLE;
1424 1424
1425 chnk->name = strdup(name); 1425 chnk->name = name;
1426 chnk->len = strlen(name) + 1; 1426 chnk->len = strlen(name) + 1;
1427 chnk->size = size; 1427 chnk->size = size;
1428 chnk->data = data; 1428 chnk->data = data;
@@ -1434,9 +1434,6 @@ eet_data_chunk_new(void *data,
1434static inline void 1434static inline void
1435eet_data_chunk_free(Eet_Data_Chunk *chnk) 1435eet_data_chunk_free(Eet_Data_Chunk *chnk)
1436{ 1436{
1437 if (chnk->name)
1438 free(chnk->name);
1439
1440 free(chnk); 1437 free(chnk);
1441} 1438}
1442 1439
@@ -1624,7 +1621,7 @@ _eet_descriptor_hash_free(Eet_Data_Descriptor *edd)
1624 1621
1625static Eet_Data_Element * 1622static Eet_Data_Element *
1626_eet_descriptor_hash_find(Eet_Data_Descriptor *edd, 1623_eet_descriptor_hash_find(Eet_Data_Descriptor *edd,
1627 char *name, 1624 const char *name,
1628 int hash) 1625 int hash)
1629{ 1626{
1630 Eet_Data_Descriptor_Hash *bucket; 1627 Eet_Data_Descriptor_Hash *bucket;