]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
parse_cache_opt: Move free() of opt past last use.
authorJulian Seward <jseward@acm.org>
Wed, 26 Jun 2002 17:02:57 +0000 (17:02 +0000)
committerJulian Seward <jseward@acm.org>
Wed, 26 Jun 2002 17:02:57 +0000 (17:02 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@469

coregrind/vg_main.c
vg_main.c

index 6f2518b2e847bfb61caaf297710149b25670c3c4..695d2a615f874c15f5b158c3a39eb291ddf91bc0 100644 (file)
@@ -511,15 +511,14 @@ static void parse_cache_opt ( cache_t* cache, char* orig_opt, int opt_len )
    while (VG_(isdigit)(opt[i])) i++;
    if ('\0' != opt[i]) goto bad;
 
-   VG_(free)(VG_AR_PRIVATE, opt);
-
    cache->size      = (Int)VG_(atoll)(opt + i1);
    cache->assoc     = (Int)VG_(atoll)(opt + i2);
    cache->line_size = (Int)VG_(atoll)(opt + i3);
 
+   VG_(free)(VG_AR_PRIVATE, opt);
    return;
 
-bad:    
+  bad:    
    bad_option(orig_opt);
 }
 
index 6f2518b2e847bfb61caaf297710149b25670c3c4..695d2a615f874c15f5b158c3a39eb291ddf91bc0 100644 (file)
--- a/vg_main.c
+++ b/vg_main.c
@@ -511,15 +511,14 @@ static void parse_cache_opt ( cache_t* cache, char* orig_opt, int opt_len )
    while (VG_(isdigit)(opt[i])) i++;
    if ('\0' != opt[i]) goto bad;
 
-   VG_(free)(VG_AR_PRIVATE, opt);
-
    cache->size      = (Int)VG_(atoll)(opt + i1);
    cache->assoc     = (Int)VG_(atoll)(opt + i2);
    cache->line_size = (Int)VG_(atoll)(opt + i3);
 
+   VG_(free)(VG_AR_PRIVATE, opt);
    return;
 
-bad:    
+  bad:    
    bad_option(orig_opt);
 }