core: balloon: Add balloon_free() function
Signed-off-by: Chloe M. <chloe@mirocom.org>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user