1
0
mirror of https://github.com/openbsd/src.git synced 2026-05-01 17:46:35 +00:00

rsync: make blkhash_free() callable with NULL.

It is in principle possible that blkhash_free() (which obviously frees
a struct blktab, sigh) is called with NULL. This would lead to a crash.

ok claudio
This commit is contained in:
tb
2024-09-27 13:13:14 +00:00
parent 54ac47722f
commit 7eb67ff9a0

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: blocks.c,v 1.26 2024/09/27 13:10:39 tb Exp $ */
/* $OpenBSD: blocks.c,v 1.27 2024/09/27 13:13:14 tb Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -125,6 +125,8 @@ blkhash_set(struct blktab *p, const struct blkset *bset)
void
blkhash_free(struct blktab *p)
{
if (p == NULL)
return;
free(p->q);
free(p->blks);
free(p);