diff options
author | Gerald Carter <jerry@samba.org> | 2003-01-21 03:42:38 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2003-01-21 03:42:38 +0000 |
commit | 2bdcf68ab680c9e2103815bf08edb519e9e62088 (patch) | |
tree | e017e605aac74e0d73f222ac47d5c6091f33244e /source3/rpc_server/srv_reg_nt.c | |
parent | 3b3551985755392970d6bf518ca739b6774915bd (diff) | |
download | samba-2bdcf68ab680c9e2103815bf08edb519e9e62088.tar.gz samba-2bdcf68ab680c9e2103815bf08edb519e9e62088.tar.bz2 samba-2bdcf68ab680c9e2103815bf08edb519e9e62088.zip |
don't free() auto variables; fixes segfault when looking up RefusePasswordChange registry value
(This used to be commit d89b0bff44fe31244b1835aee0c96c4900d90dc6)
Diffstat (limited to 'source3/rpc_server/srv_reg_nt.c')
-rw-r--r-- | source3/rpc_server/srv_reg_nt.c | 8 |
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; } |