glsl: Fix blob memory leak

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
This commit is contained in:
Bartosz Tomczyk
2017-04-03 19:39:19 +02:00
committed by Timothy Arceri
parent a4c4efad89
commit bcb63ee63e
4 changed files with 17 additions and 6 deletions

View File

@@ -27,6 +27,7 @@
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#ifdef __cplusplus
extern "C" {
@@ -79,6 +80,16 @@ struct blob_reader {
struct blob *
blob_create(void);
/**
* Destroy a blob and free its memory.
*/
static inline void
blob_destroy(struct blob *blob)
{
free(blob->data);
free(blob);
}
/**
* Add some unstructured, fixed-size data to a blob.
*