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:
Felix Fietkau 2022-02-10 21:02:16 +01:00
parent cce5e35127
commit f2d6752901

1
blob.c
View file

@ -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;
} }