summaryrefslogtreecommitdiffstats
path: root/source3/locking/brlock.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/locking/brlock.c')
-rw-r--r--source3/locking/brlock.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source3/locking/brlock.c b/source3/locking/brlock.c
index e92a2cf0ecb..c51d66b2be5 100644
--- a/source3/locking/brlock.c
+++ b/source3/locking/brlock.c
@@ -1699,10 +1699,16 @@ static bool validate_lock_entries(TALLOC_CTX *mem_ctx,
unsigned int i;
unsigned int num_valid_entries = 0;
struct lock_struct *locks = *pplocks;
- TALLOC_CTX *frame = talloc_stackframe();
+ TALLOC_CTX *frame;
struct server_id *ids;
bool *exists;
+ if (*pnum_entries == 0) {
+ return true;
+ }
+
+ frame = talloc_stackframe();
+
ids = talloc_array(frame, struct server_id, *pnum_entries);
if (ids == NULL) {
DEBUG(0, ("validate_lock_entries: "