summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-01-21 03:42:26 +0000
committerGerald Carter <jerry@samba.org>2003-01-21 03:42:26 +0000
commit2d12fa42941d708f851283833ee35d9c507ea4d8 (patch)
treeb010bc59c56326eef214a43242d7931ffc49ae0e /source3/rpc_server
parent8308ec6979d8d71903cb82963827d194d8c7bff3 (diff)
downloadsamba-2d12fa42941d708f851283833ee35d9c507ea4d8.tar.gz
samba-2d12fa42941d708f851283833ee35d9c507ea4d8.tar.bz2
samba-2d12fa42941d708f851283833ee35d9c507ea4d8.zip
don't free() auto variables; fixes segfault when looking up RefusePasswordChange registry value
(This used to be commit b3fc458e9e4b90deb971dd2495786e74c8b425bd)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_reg_nt.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source3/rpc_server/srv_reg_nt.c b/source3/rpc_server/srv_reg_nt.c
index 8fc038eab5..5632544909 100644
--- a/source3/rpc_server/srv_reg_nt.c
+++ b/source3/rpc_server/srv_reg_nt.c
@@ -352,7 +352,6 @@ NTSTATUS _reg_info(pipes_struct *p, REG_Q_INFO *q_u, REG_R_INFO *r_u)
int value_length;
REGISTRY_KEY *regkey = find_regkey_index_by_hnd( p, &q_u->pol );
REGISTRY_VALUE *val = NULL;
- REGISTRY_VALUE emptyval;
REGVAL_CTR regvals;
int i;
@@ -374,8 +373,11 @@ NTSTATUS _reg_info(pipes_struct *p, REG_Q_INFO *q_u, REG_R_INFO *r_u)
/* couple of hard coded registry values */
if ( strequal(name, "RefusePasswordChange") ) {
- ZERO_STRUCTP( &emptyval );
- val = &emptyval;
+ if ( (val = (REGISTRY_VALUE*)malloc(sizeof(REGISTRY_VALUE))) == NULL ) {
+ DEBUG(0,("_reg_info: malloc() failed!\n"));
+ return NT_STATUS_NO_MEMORY;
+ }
+ ZERO_STRUCTP( val );
goto out;
}