diff options
author | Günther Deschner <gd@samba.org> | 2010-04-26 21:00:45 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-05-05 18:17:23 +0200 |
commit | 83e324c4177f7c493c7181c8f81f6f1e02a7ad95 (patch) | |
tree | 1df794aa2f991e81194abf7177f1c867801aecfc /source3/rpc_server | |
parent | 24225bf032fb99e8949a741007cc6d199ee4702c (diff) | |
download | samba-83e324c4177f7c493c7181c8f81f6f1e02a7ad95.tar.gz samba-83e324c4177f7c493c7181c8f81f6f1e02a7ad95.tar.bz2 samba-83e324c4177f7c493c7181c8f81f6f1e02a7ad95.zip |
s3-spoolss: talloc_steal the returned driver_list in winreg_get_driver_list().
Otherwise the function would return a pointer to a freed list.
Guenther
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_spoolss_util.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source3/rpc_server/srv_spoolss_util.c b/source3/rpc_server/srv_spoolss_util.c index 82882af2dc..ecb583c3e4 100644 --- a/source3/rpc_server/srv_spoolss_util.c +++ b/source3/rpc_server/srv_spoolss_util.c @@ -4017,11 +4017,12 @@ WERROR winreg_get_driver_list(TALLOC_CTX *mem_ctx, const char *architecture, uint32_t version, uint32_t *num_drivers, - const char ***drivers) + const char ***drivers_p) { uint32_t access_mask = SEC_FLAG_MAXIMUM_ALLOWED; struct rpc_pipe_client *winreg_pipe = NULL; struct policy_handle hive_hnd, key_hnd; + const char **drivers; TALLOC_CTX *tmp_ctx; WERROR result; @@ -4055,7 +4056,7 @@ WERROR winreg_get_driver_list(TALLOC_CTX *mem_ctx, winreg_pipe, &key_hnd, num_drivers, - drivers); + &drivers); if (!W_ERROR_IS_OK(result)) { DEBUG(0, ("winreg_get_driver_list: " "Could not enumerate drivers for (%s,%u): %s\n", @@ -4063,6 +4064,8 @@ WERROR winreg_get_driver_list(TALLOC_CTX *mem_ctx, goto done; } + *drivers_p = talloc_steal(mem_ctx, drivers); + result = WERR_OK; done: if (winreg_pipe != NULL) { |