summaryrefslogtreecommitdiff
path: root/pidl
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2023-03-29 11:43:10 +1300
committerAndrew Bartlett <abartlet@samba.org>2023-03-31 01:48:30 +0000
commit0ef71cf1524e855b0ae17051b054ef27d1c95717 (patch)
tree0e12dfbd89612be8c7462d337fea36aab2c48e61 /pidl
parent327c84cf8701437324410068ab8e9a6efba24345 (diff)
downloadsamba-0ef71cf1524e855b0ae17051b054ef27d1c95717.tar.gz
pidl: Automatically manage creating and freeing the compression state in generated code
Manually written code will handle this differently, but for generated code this will create and free the context. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Diffstat (limited to 'pidl')
-rw-r--r--pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm2
1 files changed, 2 insertions, 0 deletions
diff --git a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
index 7897f257379..230b42dbbbf 100644
--- a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
@@ -514,6 +514,7 @@ sub ParseCompressionPushStart($$$$$)
$self->pidl("{");
$self->indent;
$self->pidl("struct ndr_push *$comndr;");
+ $self->pidl("NDR_CHECK(ndr_push_compression_state_init($ndr, $alg, &$ndr->cstate));");
$self->pidl("NDR_CHECK(ndr_push_compression_start($ndr, &$comndr, $alg));");
return $comndr;
@@ -526,6 +527,7 @@ sub ParseCompressionPushEnd($$$$$)
my $alg = compression_alg($e, $l, $env);
$self->pidl("NDR_CHECK(ndr_push_compression_end($ndr, $comndr, $alg));");
+ $self->pidl("NDR_CHECK(ndr_push_compression_state_free($ndr->cstate));");
$self->deindent;
$self->pidl("}");
}