Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(462)

Side by Side Diff: openssl/crypto/objects/o_names.c

Issue 59793002: sh implementation to avoid unwanted resizes during iteration. (Closed) Base URL: http://src.chromium.org/chrome/trunk/deps/third_party/openssl/
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « openssl/crypto/lhash/lhash.c ('k') | openssl/crypto/objects/obj_dat.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include <stdio.h> 1 #include <stdio.h>
2 #include <stdlib.h> 2 #include <stdlib.h>
3 #include <string.h> 3 #include <string.h>
4 4
5 #include <openssl/err.h> 5 #include <openssl/err.h>
6 #include <openssl/lhash.h> 6 #include <openssl/lhash.h>
7 #include <openssl/objects.h> 7 #include <openssl/objects.h>
8 #include <openssl/safestack.h> 8 #include <openssl/safestack.h>
9 #include <openssl/e_os2.h> 9 #include <openssl/e_os2.h>
10 10
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 343
344 static IMPLEMENT_LHASH_DOALL_FN(names_lh_free, OBJ_NAME) 344 static IMPLEMENT_LHASH_DOALL_FN(names_lh_free, OBJ_NAME)
345 345
346 static void name_funcs_free(NAME_FUNCS *ptr) 346 static void name_funcs_free(NAME_FUNCS *ptr)
347 { 347 {
348 OPENSSL_free(ptr); 348 OPENSSL_free(ptr);
349 } 349 }
350 350
351 void OBJ_NAME_cleanup(int type) 351 void OBJ_NAME_cleanup(int type)
352 { 352 {
353 unsigned long down_load;
354
355 if (names_lh == NULL) return; 353 if (names_lh == NULL) return;
356 354
357 free_type=type; 355 free_type=type;
358 down_load=lh_OBJ_NAME_down_load(names_lh);
359 lh_OBJ_NAME_down_load(names_lh)=0;
360 356
361 lh_OBJ_NAME_doall(names_lh,LHASH_DOALL_FN(names_lh_free)); 357 lh_OBJ_NAME_doall(names_lh,LHASH_DOALL_FN(names_lh_free));
362 if (type < 0) 358 if (type < 0)
363 { 359 {
364 lh_OBJ_NAME_free(names_lh); 360 lh_OBJ_NAME_free(names_lh);
365 sk_NAME_FUNCS_pop_free(name_funcs_stack,name_funcs_free); 361 sk_NAME_FUNCS_pop_free(name_funcs_stack,name_funcs_free);
366 names_lh=NULL; 362 names_lh=NULL;
367 name_funcs_stack = NULL; 363 name_funcs_stack = NULL;
368 } 364 }
369 else
370 lh_OBJ_NAME_down_load(names_lh)=down_load;
371 } 365 }
372 366
OLDNEW
« no previous file with comments | « openssl/crypto/lhash/lhash.c ('k') | openssl/crypto/objects/obj_dat.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698