Memory leaks and other fixes found by Coverity
[nivanova/samba-autobuild/.git] / source3 / rpc_server / srv_spoolss_nt.c
index 123cbf933524484ac68308403bb2c77f30743287..ba2fe774b87922ebc3fbf68100d8c1240cc337dd 100644 (file)
@@ -9927,7 +9927,8 @@ WERROR _spoolss_xcvdataport(pipes_struct *p, SPOOL_Q_XCVDATAPORT *q_u, SPOOL_R_X
 
        /* Allocate the outgoing buffer */
 
-       rpcbuf_init( &r_u->outdata, q_u->offered, p->mem_ctx );
+       if (!rpcbuf_init( &r_u->outdata, q_u->offered, p->mem_ctx ))
+               return WERR_NOMEM;
 
        switch ( Printer->printer_type ) {
        case SPLHND_PORTMON_TCP: