pidl: return early when AllocOutVar() in s3 server generator has nothing to do.
authorGünther Deschner <gd@samba.org>
Fri, 6 Feb 2009 17:51:36 +0000 (18:51 +0100)
committerGünther Deschner <gd@samba.org>
Fri, 6 Feb 2009 17:53:40 +0000 (18:53 +0100)
Jelmer, Metze, please check.

Guenther

pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm

index 33dc68e753f242b9bce9650f0506db5b60016ae0..c9a8eea59fd146f17192da43a68e4b3b9440383d 100644 (file)
@@ -58,14 +58,17 @@ sub AllocOutVar($$$$$)
        if ($l->{TYPE} eq "POINTER") {
                my $nl = GetNextLevel($e, $l);
                $l = $nl if ($nl->{TYPE} eq "ARRAY");
-       }
+       } elsif
 
        # we don't support multi-dimentional arrays yet
-       if ($l->{TYPE} eq "ARRAY") {
+       ($l->{TYPE} eq "ARRAY") {
                my $nl = GetNextLevel($e, $l);
                if ($nl->{TYPE} eq "ARRAY") {
                        fatal($e->{ORIGINAL},"multi-dimentional [out] arrays are not supported!");
                }
+       } else {
+               # neither pointer nor array, no need to alloc something.
+               return;
        }
 
        if ($l->{TYPE} eq "ARRAY") {