Initialize r.out in the server side code, in case the handler function
authorjelmer <jelmer@0c0555d6-39d7-0310-84fc-f1cc0bd64818>
Tue, 19 Sep 2006 22:18:16 +0000 (22:18 +0000)
committerjelmer <jelmer@0c0555d6-39d7-0310-84fc-f1cc0bd64818>
Tue, 19 Sep 2006 22:18:16 +0000 (22:18 +0000)
doesn't touch them.

git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_4_0@18689 0c0555d6-39d7-0310-84fc-f1cc0bd64818

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

index 4d3dba2e0ee39ef7fbc0f27c0665c8041397fe40..8ef4529402abb625f14d403075acd88f78e50f17 100644 (file)
@@ -82,11 +82,15 @@ sub ParseFunction($$)
        pidl "";
 
        my %env = ();
+       my $hasout = 0;
        foreach (@{$fn->{ELEMENTS}}) {
+               if (grep(/out/, @{$_->{DIRECTION}})) { $hasout = 1; }
                next unless (grep (/in/, @{$_->{DIRECTION}}));
                $env{$_->{NAME}} = "r.in.$_->{NAME}";
        }
 
+       pidl "ZERO_STRUCT(r.out);" if ($hasout);
+
        my $proto = "_$fn->{NAME}(pipes_struct *p";
        my $ret = "_$fn->{NAME}(p";
        foreach (@{$fn->{ELEMENTS}}) {