Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'dg/run-command-child-cleanup' into maint
author
Junio C Hamano
<gitster@pobox.com>
Thu, 20 Sep 2012 22:55:12 +0000
(15:55 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 20 Sep 2012 22:55:12 +0000
(15:55 -0700)
* dg/run-command-child-cleanup:
run-command.c: fix broken list iteration in clear_child_for_cleanup
run-command.c
patch
|
blob
|
history
raw
(from parent 1:
96c2abe
)
diff --git
a/run-command.c
b/run-command.c
index f9922b9ecc8e4956e19d7143bb6cb6ef4d97abf8..1101ef72378a502b1681a8e1bc306f38027974ae 100644
(file)
--- a/
run-command.c
+++ b/
run-command.c
@@
-53,13
+53,14
@@
static void mark_child_for_cleanup(pid_t pid)
static void clear_child_for_cleanup(pid_t pid)
{
- struct child_to_clean **
last, *
p;
+ struct child_to_clean **
p
p;
- last = &children_to_clean;
- for (p = children_to_clean; p; p = p->next) {
- if (p->pid == pid) {
- *last = p->next;
- free(p);
+ for (pp = &children_to_clean; *pp; pp = &(*pp)->next) {
+ struct child_to_clean *clean_me = *pp;
+
+ if (clean_me->pid == pid) {
+ *pp = clean_me->next;
+ free(clean_me);
return;
}
}