summaryrefslogtreecommitdiffstats
path: root/source/registry
diff options
context:
space:
mode:
authorJim McDonough <jmcd@samba.org>2002-12-03 19:24:51 +0000
committerJim McDonough <jmcd@samba.org>2002-12-03 19:24:51 +0000
commit1bf36d3fc69b8129fff08f5a735e27a94eb46d49 (patch)
tree5888479cb49f48bf2d31c77b3f508a7c5ca4f9a2 /source/registry
parentfc7d3faed798e7496f2991ec7d795c3b1a3758f5 (diff)
downloadsamba-1bf36d3fc69b8129fff08f5a735e27a94eb46d49.tar.gz
samba-1bf36d3fc69b8129fff08f5a735e27a94eb46d49.tar.xz
samba-1bf36d3fc69b8129fff08f5a735e27a94eb46d49.zip
Don't segfault when trying to delete a key when none exist.
Diffstat (limited to 'source/registry')
-rw-r--r--source/registry/reg_objects.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/registry/reg_objects.c b/source/registry/reg_objects.c
index be15e49a2f7..e6373211539 100644
--- a/source/registry/reg_objects.c
+++ b/source/registry/reg_objects.c
@@ -313,6 +313,8 @@ int regval_ctr_delvalue( REGVAL_CTR *ctr, char *name )
int i;
/* search for the value */
+ if (!(ctr->num_values))
+ return 0;
for ( i=0; i<ctr->num_values; i++ ) {
if ( strcmp( ctr->values[i]->valuename, name ) == 0)