s3-spoolss: fix enumports segfault (another malloc vs. talloc candidate).
authorGünther Deschner <gd@samba.org>
Sat, 15 Nov 2008 01:23:31 +0000 (02:23 +0100)
committerGünther Deschner <gd@samba.org>
Sat, 15 Nov 2008 01:25:17 +0000 (02:25 +0100)
Guenther

source3/rpc_server/srv_spoolss_nt.c

index 577f7f1ded0532303bb01a8ead3a69d1f9aa6ab8..59c1323a0f863f35566e00db7cb946cae89268b2 100644 (file)
@@ -7482,11 +7482,11 @@ WERROR enumports_hook(TALLOC_CTX *ctx, int *count, char ***lines )
        /* if no hook then just fill in the default port */
 
        if ( !*cmd ) {
-               if (!(qlines = SMB_MALLOC_ARRAY( char*, 2 ))) {
+               if (!(qlines = TALLOC_ARRAY( NULL, char*, 2 ))) {
                        return WERR_NOMEM;
                }
-               if (!(qlines[0] = SMB_STRDUP( SAMBA_PRINTER_PORT_NAME ))) {
-                       SAFE_FREE(qlines);
+               if (!(qlines[0] = talloc_strdup(qlines, SAMBA_PRINTER_PORT_NAME ))) {
+                       TALLOC_FREE(qlines);
                        return WERR_NOMEM;
                }
                qlines[1] = NULL;