spoolss: clear info on GetPrinterDriverDirectory error
authorDavid Disseldorp <ddiss@samba.org>
Wed, 17 Dec 2014 15:47:50 +0000 (16:47 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 19 Dec 2014 14:40:43 +0000 (15:40 +0100)
If an error is returned without zeroing a pre-allocated @info pointer,
then marshalling of the response will fail.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10984

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/rpc_server/spoolss/srv_spoolss_nt.c

index c8c670b1123afc563bf8ca76d84ae0cdd53d08f7..c34b04de898f114bfbfa7b8b8a3a02de0dcf80c8 100644 (file)
@@ -8544,6 +8544,7 @@ WERROR _spoolss_GetPrinterDriverDirectory(struct pipes_struct *p,
        /* that's an [in out] buffer */
 
        if (!r->in.buffer && (r->in.offered != 0)) {
+               TALLOC_FREE(r->out.info);
                return WERR_INVALID_PARAM;
        }