summaryrefslogtreecommitdiffstats
path: root/src/core/image.c
diff options
context:
space:
mode:
authorMichael Brown2007-01-12 07:26:59 +0100
committerMichael Brown2007-01-12 07:26:59 +0100
commit742f24286359486e31809e028c06929340106284 (patch)
treeae79e52278080d21a90999f444a35fdded38d7c7 /src/core/image.c
parentAdd basic "fetch" and "imgstat" commands. (diff)
downloadipxe-742f24286359486e31809e028c06929340106284.tar.gz
ipxe-742f24286359486e31809e028c06929340106284.tar.xz
ipxe-742f24286359486e31809e028c06929340106284.zip
Add free_image
Diffstat (limited to 'src/core/image.c')
-rw-r--r--src/core/image.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/core/image.c b/src/core/image.c
index e14e08f1..51998982 100644
--- a/src/core/image.c
+++ b/src/core/image.c
@@ -90,6 +90,23 @@ struct image * find_image ( const char *name ) {
}
/**
+ * Free loaded image
+ *
+ * @v image Executable/loadable image
+ *
+ * This releases the memory being used to store the image; it does not
+ * release the @c struct @c image itself, nor does it unregister the
+ * image.
+ */
+void free_image ( struct image *image ) {
+ if ( image->free )
+ image->free ( image->data );
+ image->free = NULL;
+ image->data = UNULL;
+ image->len = 0;
+}
+
+/**
* Load executable/loadable image into memory
*
* @v image Executable/loadable image