[37759] trunk/base/src/cregistry/registry.c

raimue at macports.org raimue at macports.org
Sat Jun 21 21:43:13 PDT 2008


Revision: 37759
          http://trac.macosforge.org/projects/macports/changeset/37759
Author:   raimue at macports.org
Date:     2008-06-21 21:43:13 -0700 (Sat, 21 Jun 2008)
Log Message:
-----------
cregistry/registry.c:
Fix an invalid free introduced in r36500.

Modified Paths:
--------------
    trunk/base/src/cregistry/registry.c

Modified: trunk/base/src/cregistry/registry.c
===================================================================
--- trunk/base/src/cregistry/registry.c	2008-06-22 01:47:12 UTC (rev 37758)
+++ trunk/base/src/cregistry/registry.c	2008-06-22 04:43:13 UTC (rev 37759)
@@ -162,12 +162,13 @@
     if (stat(path, &sb) != 0) {
         initialized = 0;
         if (errno == ENOENT) {
-            char *mypath = strdup(path);
-            mypath = dirname(mypath);
-            if (stat(mypath, &sb) != 0) {
+            char *dirc, *dname;
+            dirc = strdup(path);
+            dname = dirname(dirc);
+            if (stat(dname, &sb) != 0) {
                 can_write = 0;
             }
-            free(mypath);
+            free(dirc);
         } else {
             can_write = 0;
         }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080621/57bc1d67/attachment-0001.htm 


More information about the macports-changes mailing list