rpc_client/cli_lsarpc.c: Removed unused variable.
authorJeremy Allison <jra@samba.org>
Sat, 3 Jun 2000 00:53:07 +0000 (00:53 +0000)
committerJeremy Allison <jra@samba.org>
Sat, 3 Jun 2000 00:53:07 +0000 (00:53 +0000)
rpc_server/srv_spoolss_nt.c: Fixed more memory leaks.
smbd/nttrans.c: Fixed shadow variable problem.
Jeremy.
(This used to be commit f0a7540831181d3a47e7f8ce8be55a36a2f2aba1)

source3/rpc_client/cli_lsarpc.c
source3/rpc_server/srv_spoolss_nt.c
source3/smbd/nttrans.c

index 8362c1d1727990f1fb79952ac1cd487a47cf5b01..239d38c358f22445d0a8fa9b1e65e7a374e08632 100644 (file)
@@ -386,7 +386,7 @@ obtain a server's SAM SID and save it in the secrets database
 
 BOOL cli_lsa_get_domain_sid(struct cli_state *cli, char *server)
 {
-       fstring domain, key;
+       fstring domain;
        POLICY_HND pol;
        DOM_SID sid;
        BOOL res, res2, res3;
index 393ba64130d167569bad6fc799ae4ddfe4e7fe37..0efcbdae1ccb7a7edf86b12227fec6743c1e720b 100644 (file)
@@ -4110,6 +4110,7 @@ uint32 _spoolss_enumprinterdata(const POLICY_HND *handle, uint32 idx,
 
                DEBUG(6,("final values: [%d], [%d]\n", *out_value_len, *out_data_len));
 
+               free_a_printer(&printer, 2);
                return NT_STATUS_NO_PROBLEMO;
        }
        
@@ -4120,9 +4121,12 @@ uint32 _spoolss_enumprinterdata(const POLICY_HND *handle, uint32 idx,
 
        if (!get_specific_param_by_index(*printer, 2, idx, value, &data, &type, &data_len)) {
                safe_free(data);
+               free_a_printer(&printer, 2);
                return ERROR_NO_MORE_ITEMS;
        }
 
+       free_a_printer(&printer, 2);
+
        /* 
         * the value is:
         * - counted in bytes in the request
@@ -4194,6 +4198,7 @@ uint32 _spoolss_setprinterdata( const POLICY_HND *handle,
        else
                status = add_a_printer(*printer, 2);
 
+       free_a_printer(&printer, 2);
        return status;
 }
 
index 68844f2bca4d8bf0a1870e831a7f0c6a4346672a..e3874e1b3e8e45896553d15f1b23dc473f18a3fa 100644 (file)
@@ -1838,7 +1838,7 @@ static int call_nt_transact_query_security_desc(connection_struct *conn,
   char *data = *ppdata;
   prs_struct pd;
   SEC_DESC *psd = NULL;
-  size_t sec_desc_size;
+  size_t sd_size;
 
   files_struct *fsp = file_fsp(params,0);
 
@@ -1855,14 +1855,14 @@ static int call_nt_transact_query_security_desc(connection_struct *conn,
    * Get the permissions to return.
    */
 
-  if((sec_desc_size = get_nt_acl(fsp, &psd)) == 0)
+  if((sd_size = get_nt_acl(fsp, &psd)) == 0)
     return(UNIXERROR(ERRDOS,ERRnoaccess));
 
-  DEBUG(3,("call_nt_transact_query_security_desc: sec_desc_size = %d.\n",(int)sec_desc_size));
+  DEBUG(3,("call_nt_transact_query_security_desc: sd_size = %d.\n",(int)sd_size));
 
-  SIVAL(params,0,(uint32)sec_desc_size);
+  SIVAL(params,0,(uint32)sd_size);
 
-  if(max_data_count < sec_desc_size) {
+  if(max_data_count < sd_size) {
 
     free_sec_desc(&psd);
 
@@ -1875,13 +1875,13 @@ static int call_nt_transact_query_security_desc(connection_struct *conn,
    * Allocate the data we will point this at.
    */
 
-  data = *ppdata = Realloc(*ppdata, sec_desc_size);
+  data = *ppdata = Realloc(*ppdata, sd_size);
   if(data == NULL) {
     free_sec_desc(&psd);
     return(ERROR(ERRDOS,ERRnomem));
   }
 
-  memset(data, '\0', sec_desc_size);
+  memset(data, '\0', sd_size);
 
   /*
    * Init the parse struct we will marshall into.
@@ -1894,7 +1894,7 @@ static int call_nt_transact_query_security_desc(connection_struct *conn,
    * allocated.
    */
 
-  prs_give_memory( &pd, data, (uint32)sec_desc_size, False);
+  prs_give_memory( &pd, data, (uint32)sd_size, False);
 
   /*
    * Finally, linearize into the outgoing buffer.
@@ -1916,7 +1916,7 @@ security descriptor.\n"));
 
   free_sec_desc(&psd);
 
-  send_nt_replies(inbuf, outbuf, bufsize, 0, params, 4, data, (int)sec_desc_size);
+  send_nt_replies(inbuf, outbuf, bufsize, 0, params, 4, data, (int)sd_size);
   return -1;
 }