develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r33880 - trunk/src/ops

From:
cotto
Date:
December 14, 2008 03:35
Subject:
[svn:parrot] r33880 - trunk/src/ops
Message ID:
20081214113527.F2265CBAC8@x12.develooper.com
Author: cotto
Date: Sun Dec 14 03:35:27 2008
New Revision: 33880

Modified:
   trunk/src/ops/core.ops

Log:
[ops] free string after using it, rather than before (CID #344, CID #345)


Modified: trunk/src/ops/core.ops
==============================================================================
--- trunk/src/ops/core.ops	(original)
+++ trunk/src/ops/core.ops	Sun Dec 14 03:35:27 2008
@@ -1357,7 +1357,6 @@
 op dlvar(out PMC, invar PMC, in STR) {
     char * const name = string_to_cstring(interp, ($3));
     void * const p = Parrot_dlsym(PMC_IS_NULL($2) ? NULL : PMC_data($2), name);
-    string_cstring_free(name);
     if (p == NULL) {
         const char * const err = Parrot_dlerror();
         Parrot_warn(interp, PARROT_WARNINGS_UNDEF_FLAG,
@@ -1370,6 +1369,7 @@
         $1 = pmc_new(interp, enum_class_UnManagedStruct);
         PMC_data($1) = p;
     }
+    string_cstring_free(name);
 }
 
 inline op compreg(in STR, invar PMC) {



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About