summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2007-06-26 21:25:15 +0000
committerDave Mitchell <davem@fdisolutions.com>2007-06-26 21:25:15 +0000
commitdd5ef8e06fad97042101d2f0784676bb2111654b (patch)
treea19986b9fac38e683bb2a7f47e43181c71349db6 /ext
parentb8328daed2539ae075bccc60f3e5bb4b34f39c28 (diff)
downloadperl-dd5ef8e06fad97042101d2f0784676bb2111654b.tar.gz
avoid double-free of the thread function
p4raw-id: //depot/perl@31475
Diffstat (limited to 'ext')
-rwxr-xr-xext/threads/threads.xs6
1 files changed, 2 insertions, 4 deletions
diff --git a/ext/threads/threads.xs b/ext/threads/threads.xs
index f43b4280f7..e1414de877 100755
--- a/ext/threads/threads.xs
+++ b/ext/threads/threads.xs
@@ -688,10 +688,8 @@ S_ithread_create(
thread->init_function = newSV(0);
sv_copypv(thread->init_function, init_function);
} else {
- thread->init_function = sv_dup(init_function, &clone_param);
- if (SvREFCNT(thread->init_function) == 0) {
- SvREFCNT_inc_void(thread->init_function);
- }
+ thread->init_function =
+ SvREFCNT_inc(sv_dup(init_function, &clone_param));
}
thread->params = sv_dup(params, &clone_param);