diff options
author | Nicholas Clark <nick@ccl4.org> | 2009-05-04 18:53:39 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2009-05-04 18:53:39 +0100 |
commit | 566771cc1208eb7c5c8363435c4bd1299f0ae5e5 (patch) | |
tree | 4ce4883dab8dd75b0687434d3d6dd7d4411f50c2 /hv.c | |
parent | 1dffc4d1a24556f4e23f612d6713492847ff064b (diff) | |
download | perl-566771cc1208eb7c5c8363435c4bd1299f0ae5e5.tar.gz |
Make Perl_hek_dup() cope with a NULL "source" parameter (by returning NULL).
Change its callers to take advantage of this.
Diffstat (limited to 'hv.c')
-rw-r--r-- | hv.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -134,11 +134,15 @@ Perl_free_tied_hv_pool(pTHX) HEK * Perl_hek_dup(pTHX_ HEK *source, CLONE_PARAMS* param) { - HEK *shared = (HEK*)ptr_table_fetch(PL_ptr_table, source); + HEK *shared; PERL_ARGS_ASSERT_HEK_DUP; PERL_UNUSED_ARG(param); + if (!source) + return NULL; + + shared = (HEK*)ptr_table_fetch(PL_ptr_table, source); if (shared) { /* We already shared this hash key. */ (void)share_hek_hek(shared); |