summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorMichael BOUCHAUD <michael.bouchaud@gmail.com>2011-12-02 17:53:37 +0000
committerMichael BOUCHAUD <michael.bouchaud@gmail.com>2011-12-02 17:53:37 +0000
commit057bc8be545df9e8c88fbda0895470f16b027c31 (patch)
tree2211638f87a835844e4cd55f7f484b6d7bbf4100 /legacy
parenta1af23ce2801556074f636e7aec772612649615e (diff)
eet: revert works from discomfitor. too buggy elementary segv. I'm pleased to SPANK him :D
SVN revision: 65828
Diffstat (limited to 'legacy')
-rw-r--r--legacy/eet/ChangeLog1
-rw-r--r--legacy/eet/NEWS3
-rw-r--r--legacy/eet/src/lib/Eet_private.h136
-rw-r--r--legacy/eet/src/lib/Makefile.am1
-rw-r--r--legacy/eet/src/lib/eet_dictionary.c21
-rw-r--r--legacy/eet/src/lib/eet_lib.c177
6 files changed, 155 insertions, 184 deletions
diff --git a/legacy/eet/ChangeLog b/legacy/eet/ChangeLog
index 9db34e05f7..ed908482b7 100644
--- a/legacy/eet/ChangeLog
+++ b/legacy/eet/ChangeLog
@@ -551,4 +551,3 @@
551 551
552 * added eet_file_get to return the filename of an Eet_File 552 * added eet_file_get to return the filename of an Eet_File
553 * Eet_File filenames are now stringshared 553 * Eet_File filenames are now stringshared
554 * added mempool allocators
diff --git a/legacy/eet/NEWS b/legacy/eet/NEWS
index cccda15052..3e11314af8 100644
--- a/legacy/eet/NEWS
+++ b/legacy/eet/NEWS
@@ -6,9 +6,6 @@ Changes since Eet 1.5.0:
6Additions: 6Additions:
7 * eet_file_get to return filenames of Eet_Files 7 * eet_file_get to return filenames of Eet_Files
8 8
9Improvements:
10
11 * most allocations moved to mempools
12 9
13Eet 1.5.0 10Eet 1.5.0
14 11
diff --git a/legacy/eet/src/lib/Eet_private.h b/legacy/eet/src/lib/Eet_private.h
index 0234221b53..83f4c18a63 100644
--- a/legacy/eet/src/lib/Eet_private.h
+++ b/legacy/eet/src/lib/Eet_private.h
@@ -66,126 +66,6 @@ struct _Eet_Node
66 Eet_Node_Data data; 66 Eet_Node_Data data;
67}; 67};
68 68
69typedef struct _Eet_File_Header Eet_File_Header;
70typedef struct _Eet_File_Node Eet_File_Node;
71typedef struct _Eet_File_Directory Eet_File_Directory;
72
73struct _Eet_File
74{
75 const char *path;
76 Eina_File *readfp;
77 Eet_File_Header *header;
78 Eet_Dictionary *ed;
79 Eet_Key *key;
80 const unsigned char *data;
81 const void *x509_der;
82 const void *signature;
83 void *sha1;
84
85 Eet_File_Mode mode;
86
87 int magic;
88 int references;
89
90 unsigned long int data_size;
91 int x509_length;
92 unsigned int signature_length;
93 int sha1_length;
94
95 Eina_Lock file_lock;
96
97 unsigned char writes_pending : 1;
98 unsigned char delete_me_now : 1;
99};
100
101struct _Eet_File_Header
102{
103 int magic;
104 Eet_File_Directory *directory;
105};
106
107struct _Eet_File_Directory
108{
109 int size;
110 Eet_File_Node **nodes;
111};
112
113struct _Eet_File_Node
114{
115 char *name;
116 void *data;
117 Eet_File_Node *next; /* FIXME: make buckets linked lists */
118
119 unsigned long int offset;
120 unsigned long int dictionary_offset;
121 unsigned long int name_offset;
122
123 unsigned int name_size;
124 unsigned int size;
125 unsigned int data_size;
126
127 unsigned char free_name : 1;
128 unsigned char compression : 1;
129 unsigned char ciphered : 1;
130 unsigned char alias : 1;
131};
132
133#if 0
134/* Version 2 */
135/* NB: all int's are stored in network byte order on disk */
136/* file format: */
137int magic; /* magic number ie 0x1ee7ff00 */
138int num_directory_entries; /* number of directory entries to follow */
139int bytes_directory_entries; /* bytes of directory entries to follow */
140struct
141{
142 int offset; /* bytes offset into file for data chunk */
143 int flags; /* flags - for now 0 = uncompressed and clear, 1 = compressed and clear, 2 = uncompressed and ciphered, 3 = compressed and ciphered */
144 int size; /* size of the data chunk */
145 int data_size; /* size of the (uncompressed) data chunk */
146 int name_size; /* length in bytes of the name field */
147 char name[name_size]; /* name string (variable length) and \0 terminated */
148} directory[num_directory_entries];
149/* and now startes the data stream... */
150#endif /* if 0 */
151
152#if 0
153/* Version 3 */
154/* NB: all int's are stored in network byte order on disk */
155/* file format: */
156int magic; /* magic number ie 0x1ee70f42 */
157int num_directory_entries; /* number of directory entries to follow */
158int num_dictionary_entries; /* number of dictionary entries to follow */
159struct
160{
161 int data_offset; /* bytes offset into file for data chunk */
162 int size; /* size of the data chunk */
163 int data_size; /* size of the (uncompressed) data chunk */
164 int name_offset; /* bytes offset into file for name string */
165 int name_size; /* length in bytes of the name field */
166 int flags; /* bit flags - for now:
167 bit 0 => compresion on/off
168 bit 1 => ciphered on/off
169 bit 2 => alias
170 */
171} directory[num_directory_entries];
172struct
173{
174 int hash;
175 int offset;
176 int size;
177 int prev;
178 int next;
179} dictionary[num_dictionary_entries];
180/* now start the string stream. */
181/* and right after them the data stream. */
182int magic_sign; /* Optional, only if the eet file is signed. */
183int signature_length; /* Signature length. */
184int x509_length; /* Public certificate that signed the file. */
185char signature[signature_length]; /* The signature. */
186char x509[x509_length]; /* The public certificate. */
187#endif /* if 0 */
188
189/* 69/*
190 * variable and macros used for the eina_log module 70 * variable and macros used for the eina_log module
191 */ 71 */
@@ -298,22 +178,6 @@ Eet_Node *
298void 178void
299 eet_node_free(Eet_Node *node); 179 eet_node_free(Eet_Node *node);
300 180
301
302#define GENERIC_ALLOC_FREE_HEADER(TYPE, Type) \
303 TYPE *Type##_malloc(unsigned int); \
304 TYPE *Type##_calloc(unsigned int); \
305 void Type##_mp_free(TYPE *e);
306
307GENERIC_ALLOC_FREE_HEADER(Eet_File_Directory, eet_file_directory);
308GENERIC_ALLOC_FREE_HEADER(Eet_File_Node, eet_file_node);
309GENERIC_ALLOC_FREE_HEADER(Eet_File_Header, eet_file_header);
310GENERIC_ALLOC_FREE_HEADER(Eet_Dictionary, eet_dictionary);
311GENERIC_ALLOC_FREE_HEADER(Eet_File, eet_file);
312GENERIC_ALLOC_FREE_HEADER(Eet_String, eet_string);
313
314Eina_Bool eet_mempool_init(void);
315void eet_mempool_shutdown(void);
316
317#ifndef PATH_MAX 181#ifndef PATH_MAX
318# define PATH_MAX 4096 182# define PATH_MAX 4096
319#endif /* ifndef PATH_MAX */ 183#endif /* ifndef PATH_MAX */
diff --git a/legacy/eet/src/lib/Makefile.am b/legacy/eet/src/lib/Makefile.am
index ae60168596..4633749d39 100644
--- a/legacy/eet/src/lib/Makefile.am
+++ b/legacy/eet/src/lib/Makefile.am
@@ -22,7 +22,6 @@ includesdir = $(includedir)/eet-@VMAJ@
22lib_LTLIBRARIES = libeet.la 22lib_LTLIBRARIES = libeet.la
23 23
24base_sources = \ 24base_sources = \
25eet_alloc.c \
26eet_lib.c \ 25eet_lib.c \
27eet_data.c \ 26eet_data.c \
28eet_image.c \ 27eet_image.c \
diff --git a/legacy/eet/src/lib/eet_dictionary.c b/legacy/eet/src/lib/eet_dictionary.c
index d551d5f254..3f35066266 100644
--- a/legacy/eet/src/lib/eet_dictionary.c
+++ b/legacy/eet/src/lib/eet_dictionary.c
@@ -28,20 +28,21 @@ eet_dictionary_add(void)
28void 28void
29eet_dictionary_free(Eet_Dictionary *ed) 29eet_dictionary_free(Eet_Dictionary *ed)
30{ 30{
31 int i; 31 if (ed)
32 {
33 int i;
32 34
33 if (!ed) return; 35 for (i = 0; i < ed->count; ++i)
36 if (ed->all[i].allocated)
37 eina_stringshare_del(ed->all[i].str);
34 38
35 for (i = 0; i < ed->count; ++i) 39 if (ed->all)
36 if (ed->all[i].allocated) 40 free(ed->all);
37 eina_stringshare_del(ed->all[i].str);
38 41
39 if (ed->all) 42 if (ed->converts) eina_hash_free(ed->converts);
40 eet_string_mp_free(ed->all);
41 43
42 if (ed->converts) eina_hash_free(ed->converts); 44 free(ed);
43 45 }
44 eet_dictionary_mp_free(ed);
45} 46}
46 47
47static int 48static int
diff --git a/legacy/eet/src/lib/eet_lib.c b/legacy/eet/src/lib/eet_lib.c
index dc1529003f..089f9d3ccc 100644
--- a/legacy/eet/src/lib/eet_lib.c
+++ b/legacy/eet/src/lib/eet_lib.c
@@ -82,6 +82,126 @@ EAPI Eet_Version *eet_version = &_version;
82 82
83#define EET_MAGIC_FILE2 0x1ee70f42 83#define EET_MAGIC_FILE2 0x1ee70f42
84 84
85typedef struct _Eet_File_Header Eet_File_Header;
86typedef struct _Eet_File_Node Eet_File_Node;
87typedef struct _Eet_File_Directory Eet_File_Directory;
88
89struct _Eet_File
90{
91 const char *path;
92 Eina_File *readfp;
93 Eet_File_Header *header;
94 Eet_Dictionary *ed;
95 Eet_Key *key;
96 const unsigned char *data;
97 const void *x509_der;
98 const void *signature;
99 void *sha1;
100
101 Eet_File_Mode mode;
102
103 int magic;
104 int references;
105
106 unsigned long int data_size;
107 int x509_length;
108 unsigned int signature_length;
109 int sha1_length;
110
111 Eina_Lock file_lock;
112
113 unsigned char writes_pending : 1;
114 unsigned char delete_me_now : 1;
115};
116
117struct _Eet_File_Header
118{
119 int magic;
120 Eet_File_Directory *directory;
121};
122
123struct _Eet_File_Directory
124{
125 int size;
126 Eet_File_Node **nodes;
127};
128
129struct _Eet_File_Node
130{
131 char *name;
132 void *data;
133 Eet_File_Node *next; /* FIXME: make buckets linked lists */
134
135 unsigned long int offset;
136 unsigned long int dictionary_offset;
137 unsigned long int name_offset;
138
139 unsigned int name_size;
140 unsigned int size;
141 unsigned int data_size;
142
143 unsigned char free_name : 1;
144 unsigned char compression : 1;
145 unsigned char ciphered : 1;
146 unsigned char alias : 1;
147};
148
149#if 0
150/* Version 2 */
151/* NB: all int's are stored in network byte order on disk */
152/* file format: */
153int magic; /* magic number ie 0x1ee7ff00 */
154int num_directory_entries; /* number of directory entries to follow */
155int bytes_directory_entries; /* bytes of directory entries to follow */
156struct
157{
158 int offset; /* bytes offset into file for data chunk */
159 int flags; /* flags - for now 0 = uncompressed and clear, 1 = compressed and clear, 2 = uncompressed and ciphered, 3 = compressed and ciphered */
160 int size; /* size of the data chunk */
161 int data_size; /* size of the (uncompressed) data chunk */
162 int name_size; /* length in bytes of the name field */
163 char name[name_size]; /* name string (variable length) and \0 terminated */
164} directory[num_directory_entries];
165/* and now startes the data stream... */
166#endif /* if 0 */
167
168#if 0
169/* Version 3 */
170/* NB: all int's are stored in network byte order on disk */
171/* file format: */
172int magic; /* magic number ie 0x1ee70f42 */
173int num_directory_entries; /* number of directory entries to follow */
174int num_dictionary_entries; /* number of dictionary entries to follow */
175struct
176{
177 int data_offset; /* bytes offset into file for data chunk */
178 int size; /* size of the data chunk */
179 int data_size; /* size of the (uncompressed) data chunk */
180 int name_offset; /* bytes offset into file for name string */
181 int name_size; /* length in bytes of the name field */
182 int flags; /* bit flags - for now:
183 bit 0 => compresion on/off
184 bit 1 => ciphered on/off
185 bit 2 => alias
186 */
187} directory[num_directory_entries];
188struct
189{
190 int hash;
191 int offset;
192 int size;
193 int prev;
194 int next;
195} dictionary[num_dictionary_entries];
196/* now start the string stream. */
197/* and right after them the data stream. */
198int magic_sign; /* Optional, only if the eet file is signed. */
199int signature_length; /* Signature length. */
200int x509_length; /* Public certificate that signed the file. */
201char signature[signature_length]; /* The signature. */
202char x509[x509_length]; /* The public certificate. */
203#endif /* if 0 */
204
85#define EET_FILE2_HEADER_COUNT 3 205#define EET_FILE2_HEADER_COUNT 3
86#define EET_FILE2_DIRECTORY_ENTRY_COUNT 6 206#define EET_FILE2_DIRECTORY_ENTRY_COUNT 6
87#define EET_FILE2_DICTIONARY_ENTRY_COUNT 5 207#define EET_FILE2_DICTIONARY_ENTRY_COUNT 5
@@ -574,16 +694,10 @@ eet_init(void)
574 694
575 eina_lock_new(&eet_cache_lock); 695 eina_lock_new(&eet_cache_lock);
576 696
577 if (!eet_mempool_init())
578 {
579 EINA_LOG_ERR("Eet: Eet_Node mempool creation failed");
580 goto unregister_log_domain;
581 }
582
583 if (!eet_node_init()) 697 if (!eet_node_init())
584 { 698 {
585 EINA_LOG_ERR("Eet: Eet_Node mempool creation failed"); 699 EINA_LOG_ERR("Eet: Eet_Node mempool creation failed");
586 goto shutdown_mempool; 700 goto unregister_log_domain;
587 } 701 }
588 702
589#ifdef HAVE_GNUTLS 703#ifdef HAVE_GNUTLS
@@ -627,8 +741,6 @@ eet_init(void)
627shutdown_eet: 741shutdown_eet:
628#endif 742#endif
629 eet_node_shutdown(); 743 eet_node_shutdown();
630shutdown_mempool:
631 eet_mempool_shutdown();
632unregister_log_domain: 744unregister_log_domain:
633 eina_log_domain_unregister(_eet_log_dom_global); 745 eina_log_domain_unregister(_eet_log_dom_global);
634 _eet_log_dom_global = -1; 746 _eet_log_dom_global = -1;
@@ -645,7 +757,6 @@ eet_shutdown(void)
645 757
646 eet_clearcache(); 758 eet_clearcache();
647 eet_node_shutdown(); 759 eet_node_shutdown();
648 eet_mempool_shutdown();
649 760
650 eina_lock_free(&eet_cache_lock); 761 eina_lock_free(&eet_cache_lock);
651 762
@@ -791,14 +902,14 @@ eet_internal_read2(Eet_File *ef)
791 return NULL; 902 return NULL;
792 903
793 /* allocate header */ 904 /* allocate header */
794 ef->header = eet_file_header_calloc(1); 905 ef->header = calloc(1, sizeof(Eet_File_Header));
795 if (eet_test_close(!ef->header, ef)) 906 if (eet_test_close(!ef->header, ef))
796 return NULL; 907 return NULL;
797 908
798 ef->header->magic = EET_MAGIC_FILE_HEADER; 909 ef->header->magic = EET_MAGIC_FILE_HEADER;
799 910
800 /* allocate directory block in ram */ 911 /* allocate directory block in ram */
801 ef->header->directory = eet_file_directory_calloc(1); 912 ef->header->directory = calloc(1, sizeof(Eet_File_Directory));
802 if (eet_test_close(!ef->header->directory, ef)) 913 if (eet_test_close(!ef->header->directory, ef))
803 return NULL; 914 return NULL;
804 915
@@ -828,10 +939,10 @@ eet_internal_read2(Eet_File *ef)
828 939
829 /* out directory block is inconsistent - we have overrun our */ 940 /* out directory block is inconsistent - we have overrun our */
830 /* dynamic block buffer before we finished scanning dir entries */ 941 /* dynamic block buffer before we finished scanning dir entries */
831 efn = eet_file_node_malloc(1); 942 efn = malloc(sizeof(Eet_File_Node));
832 if (eet_test_close(!efn, ef)) 943 if (eet_test_close(!efn, ef))
833 { 944 {
834 if (efn) eet_file_node_mp_free(efn); /* yes i know - we only get here if 945 if (efn) free(efn); /* yes i know - we only get here if
835 * efn is null/0 -> trying to shut up 946 * efn is null/0 -> trying to shut up
836 * warning tools like cppcheck */ 947 * warning tools like cppcheck */
837 return NULL; 948 return NULL;
@@ -911,11 +1022,11 @@ eet_internal_read2(Eet_File *ef)
911 ef)) 1022 ef))
912 return NULL; 1023 return NULL;
913 1024
914 ef->ed = eet_dictionary_calloc(1); 1025 ef->ed = calloc(1, sizeof (Eet_Dictionary));
915 if (eet_test_close(!ef->ed, ef)) 1026 if (eet_test_close(!ef->ed, ef))
916 return NULL; 1027 return NULL;
917 1028
918 ef->ed->all = eet_string_calloc(num_dictionary_entries); 1029 ef->ed->all = calloc(num_dictionary_entries, sizeof (Eet_String));
919 if (eet_test_close(!ef->ed->all, ef)) 1030 if (eet_test_close(!ef->ed->all, ef))
920 return NULL; 1031 return NULL;
921 1032
@@ -1051,14 +1162,14 @@ eet_internal_read1(Eet_File *ef)
1051 return NULL; 1162 return NULL;
1052 1163
1053 /* allocate header */ 1164 /* allocate header */
1054 ef->header = eet_file_header_calloc(1); 1165 ef->header = calloc(1, sizeof(Eet_File_Header));
1055 if (eet_test_close(!ef->header, ef)) 1166 if (eet_test_close(!ef->header, ef))
1056 return NULL; 1167 return NULL;
1057 1168
1058 ef->header->magic = EET_MAGIC_FILE_HEADER; 1169 ef->header->magic = EET_MAGIC_FILE_HEADER;
1059 1170
1060 /* allocate directory block in ram */ 1171 /* allocate directory block in ram */
1061 ef->header->directory = eet_file_directory_calloc(1); 1172 ef->header->directory = calloc(1, sizeof(Eet_File_Directory));
1062 if (eet_test_close(!ef->header->directory, ef)) 1173 if (eet_test_close(!ef->header->directory, ef))
1063 return NULL; 1174 return NULL;
1064 1175
@@ -1096,7 +1207,7 @@ eet_internal_read1(Eet_File *ef)
1096 efn = malloc (sizeof(Eet_File_Node)); 1207 efn = malloc (sizeof(Eet_File_Node));
1097 if (eet_test_close(!efn, ef)) 1208 if (eet_test_close(!efn, ef))
1098 { 1209 {
1099 if (efn) eet_file_node_mp_free(efn); /* yes i know - we only get here if 1210 if (efn) free(efn); /* yes i know - we only get here if
1100 * efn is null/0 -> trying to shut up 1211 * efn is null/0 -> trying to shut up
1101 * warning tools like cppcheck */ 1212 * warning tools like cppcheck */
1102 return NULL; 1213 return NULL;
@@ -1116,21 +1227,21 @@ eet_internal_read1(Eet_File *ef)
1116 /* invalid size */ 1227 /* invalid size */
1117 if (eet_test_close(efn->size <= 0, ef)) 1228 if (eet_test_close(efn->size <= 0, ef))
1118 { 1229 {
1119 eet_file_node_mp_free(efn); 1230 free(efn);
1120 return NULL; 1231 return NULL;
1121 } 1232 }
1122 1233
1123 /* invalid name_size */ 1234 /* invalid name_size */
1124 if (eet_test_close(name_size <= 0, ef)) 1235 if (eet_test_close(name_size <= 0, ef))
1125 { 1236 {
1126 eet_file_node_mp_free(efn); 1237 free(efn);
1127 return NULL; 1238 return NULL;
1128 } 1239 }
1129 1240
1130 /* reading name would mean falling off end of dyn_buf - invalid */ 1241 /* reading name would mean falling off end of dyn_buf - invalid */
1131 if (eet_test_close((p + 16 + name_size) > (dyn_buf + byte_entries), ef)) 1242 if (eet_test_close((p + 16 + name_size) > (dyn_buf + byte_entries), ef))
1132 { 1243 {
1133 eet_file_node_mp_free(efn); 1244 free(efn);
1134 return NULL; 1245 return NULL;
1135 } 1246 }
1136 1247
@@ -1146,7 +1257,7 @@ eet_internal_read1(Eet_File *ef)
1146 efn->name = malloc(sizeof(char) * name_size + 1); 1257 efn->name = malloc(sizeof(char) * name_size + 1);
1147 if (eet_test_close(!efn->name, ef)) 1258 if (eet_test_close(!efn->name, ef))
1148 { 1259 {
1149 eet_file_node_mp_free(efn); 1260 free(efn);
1150 return NULL; 1261 return NULL;
1151 } 1262 }
1152 1263
@@ -1294,16 +1405,16 @@ eet_internal_close(Eet_File *ef,
1294 if (efn->free_name) 1405 if (efn->free_name)
1295 free(efn->name); 1406 free(efn->name);
1296 1407
1297 eet_file_node_mp_free(efn); 1408 free(efn);
1298 } 1409 }
1299 } 1410 }
1300 free(ef->header->directory->nodes); 1411 free(ef->header->directory->nodes);
1301 } 1412 }
1302 1413
1303 eet_file_directory_mp_free(ef->header->directory); 1414 free(ef->header->directory);
1304 } 1415 }
1305 1416
1306 eet_file_header_mp_free(ef->header); 1417 free(ef->header);
1307 } 1418 }
1308 1419
1309 eet_dictionary_free(ef->ed); 1420 eet_dictionary_free(ef->ed);
@@ -1324,7 +1435,7 @@ eet_internal_close(Eet_File *ef,
1324 1435
1325 /* free it */ 1436 /* free it */
1326 eina_stringshare_del(ef->path); 1437 eina_stringshare_del(ef->path);
1327 eet_file_mp_free(ef); 1438 free(ef);
1328 return err; 1439 return err;
1329 1440
1330on_error: 1441on_error:
@@ -1475,7 +1586,7 @@ open_error:
1475 file_len = strlen(file) + 1; 1586 file_len = strlen(file) + 1;
1476 1587
1477 /* Allocate struct for eet file and have it zero'd out */ 1588 /* Allocate struct for eet file and have it zero'd out */
1478 ef = eet_file_malloc(1); 1589 ef = malloc(sizeof(Eet_File));
1479 if (!ef) 1590 if (!ef)
1480 goto on_error; 1591 goto on_error;
1481 1592
@@ -2007,7 +2118,7 @@ eet_alias(Eet_File *ef,
2007 ef->header->directory = calloc(1, sizeof(Eet_File_Directory)); 2118 ef->header->directory = calloc(1, sizeof(Eet_File_Directory));
2008 if (!ef->header->directory) 2119 if (!ef->header->directory)
2009 { 2120 {
2010 eet_file_header_mp_free(ef->header); 2121 free(ef->header);
2011 ef->header = NULL; 2122 ef->header = NULL;
2012 goto on_error; 2123 goto on_error;
2013 } 2124 }
@@ -2020,7 +2131,7 @@ eet_alias(Eet_File *ef,
2020 (1 << ef->header->directory->size)); 2131 (1 << ef->header->directory->size));
2021 if (!ef->header->directory->nodes) 2132 if (!ef->header->directory->nodes)
2022 { 2133 {
2023 eet_file_directory_mp_free(ef->header->directory); 2134 free(ef->header->directory);
2024 ef->header = NULL; 2135 ef->header = NULL;
2025 goto on_error; 2136 goto on_error;
2026 } 2137 }
@@ -2167,7 +2278,7 @@ eet_write_cipher(Eet_File *ef,
2167 ef->header->directory = calloc(1, sizeof(Eet_File_Directory)); 2278 ef->header->directory = calloc(1, sizeof(Eet_File_Directory));
2168 if (!ef->header->directory) 2279 if (!ef->header->directory)
2169 { 2280 {
2170 eet_file_header_mp_free(ef->header); 2281 free(ef->header);
2171 ef->header = NULL; 2282 ef->header = NULL;
2172 goto on_error; 2283 goto on_error;
2173 } 2284 }
@@ -2180,7 +2291,7 @@ eet_write_cipher(Eet_File *ef,
2180 (1 << ef->header->directory->size)); 2291 (1 << ef->header->directory->size));
2181 if (!ef->header->directory->nodes) 2292 if (!ef->header->directory->nodes)
2182 { 2293 {
2183 eet_file_directory_mp_free(ef->header->directory); 2294 free(ef->header->directory);
2184 ef->header = NULL; 2295 ef->header = NULL;
2185 goto on_error; 2296 goto on_error;
2186 } 2297 }
@@ -2368,7 +2479,7 @@ eet_delete(Eet_File *ef,
2368 if (efn->free_name) 2479 if (efn->free_name)
2369 free(efn->name); 2480 free(efn->name);
2370 2481
2371 eet_file_node_mp_free(efn); 2482 free(efn);
2372 exists_already = 1; 2483 exists_already = 1;
2373 break; 2484 break;
2374 } 2485 }