core: balloon: Add balloon_free() function

Signed-off-by: Chloe M. <chloe@mirocom.org>
This commit is contained in:
2026-05-24 17:02:40 -05:00
parent e6298f1e76
commit bf49cd33a3
2 changed files with 20 additions and 0 deletions
+13
View File
@@ -73,3 +73,16 @@ balloon_memcpy(struct mvm_balloon *dest, off_t off, void *source, size_t count)
memcpy((char *)dest->data + off, source, count);
return 0;
}
void
balloon_free(struct mvm_balloon *bp)
{
if (bp == NULL) {
return;
}
if (bp->data != NULL) {
free(bp->data);
bp->data = NULL;
}
}