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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user