From: Cedric BAIL Date: Thu, 9 Aug 2012 11:03:22 +0000 (+0000) Subject: eet: don't copy string around. X-Git-Tag: submit/devel/efl/20131022.203902~4704 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=addf4cccd05a31cffb06427eb970f484c3dbfec6;p=platform%2Fupstream%2Fefl.git eet: don't copy string around. SVN revision: 75040 --- diff --git a/legacy/eet/ChangeLog b/legacy/eet/ChangeLog index 0ce223a..ce6ba0e 100644 --- a/legacy/eet/ChangeLog +++ b/legacy/eet/ChangeLog @@ -607,3 +607,7 @@ * Add code to detect overrun and underrun in eet_data_descriptor_element_add. * Fix possible wrong size decoding for simple type. + +2012-08-09 Cedric Bail + + * Don't copy string around for nothing. diff --git a/legacy/eet/NEWS b/legacy/eet/NEWS index 456bd180..4b8370c 100644 --- a/legacy/eet/NEWS +++ b/legacy/eet/NEWS @@ -12,6 +12,7 @@ Fixes: * Check that gnutls and openssl don't return below zero size during decipher. * Fix crash when cyphering huge amount of data. * Possible wrong size decoding of simple type. + * Don't strdup string around for nothing. Eet 1.6.0 diff --git a/legacy/eet/src/lib/eet_data.c b/legacy/eet/src/lib/eet_data.c index 4093740..0b8537c 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 struct _Eet_Data_Chunk { - char *name; + const char *name; int len; int size; int hash; @@ -1422,7 +1422,7 @@ eet_data_chunk_new(void *data, || type == EET_T_F8P24) type = EET_T_DOUBLE; - chnk->name = strdup(name); + chnk->name = name; chnk->len = strlen(name) + 1; chnk->size = size; chnk->data = data; @@ -1434,9 +1434,6 @@ eet_data_chunk_new(void *data, static inline void eet_data_chunk_free(Eet_Data_Chunk *chnk) { - if (chnk->name) - free(chnk->name); - free(chnk); } @@ -1624,7 +1621,7 @@ _eet_descriptor_hash_free(Eet_Data_Descriptor *edd) static Eet_Data_Element * _eet_descriptor_hash_find(Eet_Data_Descriptor *edd, - char *name, + const char *name, int hash) { Eet_Data_Descriptor_Hash *bucket;