In Perl_mg_dup(), the while loop does the NULL check for us already.
Nicholas Clark [Mon, 18 May 2009 10:42:01 +0000 (11:42 +0100)]
sv.c

diff --git a/sv.c b/sv.c
index c21b8ce..0b95142 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -10510,13 +10510,10 @@ MAGIC *
 Perl_mg_dup(pTHX_ MAGIC *mg, CLONE_PARAMS *const param)
 {
     MAGIC *mgprev = (MAGIC*)NULL;
-    MAGIC *mgret;
+    MAGIC *mgret = NULL;
 
     PERL_ARGS_ASSERT_MG_DUP;
 
-    if (!mg)
-       return (MAGIC*)NULL;
-
     for (; mg; mg = mg->mg_moremagic) {
        MAGIC *nmg;
        Newxz(nmg, 1, MAGIC);