------------------------------------------------------------
revno: 1389
committer: Steve Langasek <[email protected]>
branch nick: upstream
timestamp: Wed 2012-11-21 00:48:08 -0600
message:
simplify code: avoid extra unnecessary strdup
modified:
init/job_process.c
--
lp:upstart
https://code.launchpad.net/~upstart-devel/upstart/trunk
Your team Upstart Reviewers is subscribed to branch lp:upstart.
To unsubscribe from this branch go to
https://code.launchpad.net/~upstart-devel/upstart/trunk/+edit-subscription
=== modified file 'init/job_process.c'
--- init/job_process.c 2012-11-19 09:48:17 +0000
+++ init/job_process.c 2012-11-21 06:48:08 +0000
@@ -2154,14 +2154,12 @@
* file within the chroot.
*/
if (job->class->session && job->class->session->chroot) {
- nih_local char *tmp = NULL;
-
- tmp = NIH_MUST (nih_strdup (NULL, dir));
- nih_free (dir);
+ char *tmp = dir;
dir = nih_sprintf (NULL, "%s%s",
job->class->session->chroot,
tmp);
+ nih_free (tmp);
}
class_name = nih_strdup (NULL, class->name);
--
upstart-devel mailing list
[email protected]
Modify settings or unsubscribe at:
https://lists.ubuntu.com/mailman/listinfo/upstart-devel