blob: clear buf->head when freeing a buffer
Prevents accidental silent use-after-free bugs Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
cce5e35127
commit
f2d6752901
1 changed files with 1 additions and 0 deletions
1
blob.c
1
blob.c
|
@ -105,6 +105,7 @@ blob_buf_free(struct blob_buf *buf)
|
||||||
{
|
{
|
||||||
free(buf->buf);
|
free(buf->buf);
|
||||||
buf->buf = NULL;
|
buf->buf = NULL;
|
||||||
|
buf->head = NULL;
|
||||||
buf->buflen = 0;
|
buf->buflen = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue