summaryrefslogtreecommitdiff
path: root/source3
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
commit8bd12bc330e3d7b9d6c949c2f0eb7d019f0e0dfb (patch)
tree00c5c49d023831729398d49b724ddfaacaec8ab8 /source3
parent9a0b6a2273f2b9ff58466a6a7402390dfbf512d2 (diff)
downloadsamba-8bd12bc330e3d7b9d6c949c2f0eb7d019f0e0dfb.tar.gz
samba-8bd12bc330e3d7b9d6c949c2f0eb7d019f0e0dfb.tar.bz2
samba-8bd12bc330e3d7b9d6c949c2f0eb7d019f0e0dfb.zip
Don't segfault when trying to delete a key when none exist.
(This used to be commit 1bf36d3fc69b8129fff08f5a735e27a94eb46d49)
Diffstat (limited to 'source3')
-rw-r--r--source3/registry/reg_objects.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source3/registry/reg_objects.c b/source3/registry/reg_objects.c
index be15e49a2f..e637321153 100644
--- a/source3/registry/reg_objects.c
+++ b/source3/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)