[launchd-changes] [23855] trunk/launchd/src/launchctl.c

source_changes at macosforge.org source_changes at macosforge.org
Mon Mar 9 18:21:53 PDT 2009


Revision: 23855
          http://trac.macosforge.org/projects/launchd/changeset/23855
Author:   dsorresso at apple.com
Date:     2009-03-09 18:21:52 -0700 (Mon, 09 Mar 2009)
Log Message:
-----------
Fixed a premature free().

Modified Paths:
--------------
    trunk/launchd/src/launchctl.c

Modified: trunk/launchd/src/launchctl.c
===================================================================
--- trunk/launchd/src/launchctl.c	2009-03-10 00:16:51 UTC (rev 23854)
+++ trunk/launchd/src/launchctl.c	2009-03-10 01:21:52 UTC (rev 23855)
@@ -2234,7 +2234,6 @@
 		g_job_overrides_db_path[0] = 0;
 	} else {
 		strncpy(g_job_overrides_db_path, db, strlen(db));
-		free(db);
 		
 		/* If we can't create or lock the overrides database, we'll fall back to writing to the
 		 * plist file directly.
@@ -2246,6 +2245,7 @@
 				g_job_overrides_db = CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
 			}
 		}
+		free(db);
 	}
 
 	/* I wish I didn't need to do three passes, but I need to load mDNSResponder and use it too.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/launchd-changes/attachments/20090309/8ef1a026/attachment.html>


More information about the launchd-changes mailing list