Browse Source

blob: clear buf->head when freeing a buffer

Prevents accidental silent use-after-free bugs

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau 2 years ago
parent
commit
f2d6752901
1 changed files with 1 additions and 0 deletions
  1. 1 0
      blob.c

+ 1 - 0
blob.c

@@ -105,6 +105,7 @@ blob_buf_free(struct blob_buf *buf)
 {
 	free(buf->buf);
 	buf->buf = NULL;
+	buf->head = NULL;
 	buf->buflen = 0;
 }