From: Douglas Bagnall Date: Sat, 7 Dec 2019 09:45:47 +0000 (+1300) Subject: selftest/s4: properly initialise an empty hash X-Git-Tag: ldb-2.1.1~202 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a65a26a2fb355d34801b5559c59cd82388646a8;p=thirdparty%2Fsamba.git selftest/s4: properly initialise an empty hash The '%ret = {}' construction was bad because '{}' is a hash-ref, which counts as a single scalar value, but a true hash like '%ret' must be initialised with an even number of scalar values (usually in pairs, like '($a => $b, $c => $d)'). I think this meant %ret was initialised as something harmless like '( => undef)'. Signed-off-by: Douglas Bagnall Reviewed-by: Gary Lockyer Reviewed-by: Andrew Bartlett --- diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm index 6f26d8a56f8..91e0878681a 100755 --- a/selftest/target/Samba4.pm +++ b/selftest/target/Samba4.pm @@ -1756,7 +1756,7 @@ sub provision_rodc($$$) sub read_config_h($) { my ($name) = @_; - my %ret = {}; + my %ret; open(LF, "<$name") or die("unable to read $name: $!"); while () { chomp;