glsl: Fix blob memory leak
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
This commit is contained in:

committed by
Timothy Arceri

parent
a4c4efad89
commit
bcb63ee63e
@@ -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.
|
||||
*
|
||||
|
Reference in New Issue
Block a user