Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/faf4c1fb6012941134046db14370f60748184b05
...commit
http://git.netsurf-browser.org/netsurf.git/commit/faf4c1fb6012941134046db14370f60748184b05
...tree
http://git.netsurf-browser.org/netsurf.git/tree/faf4c1fb6012941134046db14370f60748184b05
The branch, master has been updated
via faf4c1fb6012941134046db14370f60748184b05 (commit)
from 61a00c3832332bc27b991d3e20702a7f900e5098 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=faf4c1fb6012941134046db14370f60748184b05
commit faf4c1fb6012941134046db14370f60748184b05
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>
Free and clear icondata to avoid a potential double-free
diff --git a/frontends/amiga/bitmap.c b/frontends/amiga/bitmap.c
index 7609d94..124c116 100644
--- a/frontends/amiga/bitmap.c
+++ b/frontends/amiga/bitmap.c
@@ -730,14 +730,15 @@ void ami_bitmap_set_title(struct bitmap *bm, const char
*title)
bm->title = strdup(title);
}
-ULONG *ami_bitmap_get_icondata(struct bitmap *bm)
+void ami_bitmap_set_icondata(struct bitmap *bm, ULONG *icondata)
{
- return bm->icondata;
+ bm->icondata = icondata;
}
-void ami_bitmap_set_icondata(struct bitmap *bm, ULONG *icondata)
+void ami_bitmap_free_icondata(struct bitmap *bm)
{
- bm->icondata = icondata;
+ if(bm->icondata) FreeVec(bm->icondata);
+ bm->icondata = NULL;
}
bool ami_bitmap_is_nativebm(struct bitmap *bm, struct BitMap *nbm)
diff --git a/frontends/amiga/bitmap.h b/frontends/amiga/bitmap.h
index 771ded4..a32d740 100755
--- a/frontends/amiga/bitmap.h
+++ b/frontends/amiga/bitmap.h
@@ -63,24 +63,24 @@ void ami_bitmap_set_url(struct bitmap *bm, struct nsurl
*url);
void ami_bitmap_set_title(struct bitmap *bm, const char *title);
/**
- * Get an icondata pointer
+ * Set an icondata pointer
*
* \param bm a bitmap, as returned by bitmap_create()
- * \return pointer to the icondata area
+ * \param icondata a pointer to memory
*
* This function probably shouldn't be here!
*/
-ULONG *ami_bitmap_get_icondata(struct bitmap *bm);
+void ami_bitmap_set_icondata(struct bitmap *bm, ULONG *icondata);
/**
- * Set an icondata pointer
+ * Free an icondata pointer
*
* \param bm a bitmap, as returned by bitmap_create()
* \param icondata a pointer to memory
*
* This function probably shouldn't be here!
*/
-void ami_bitmap_set_icondata(struct bitmap *bm, ULONG *icondata);
+void ami_bitmap_free_icondata(struct bitmap *bm);
/**
* Test if a BitMap is owned by a bitmap.
diff --git a/frontends/amiga/icon.c b/frontends/amiga/icon.c
index bd79a55..fd996ef 100644
--- a/frontends/amiga/icon.c
+++ b/frontends/amiga/icon.c
@@ -543,6 +543,6 @@ void amiga_icon_free(struct DiskObject *dobj)
struct bitmap *bm = dobj->do_Gadget.UserData;
FreeDiskObject(dobj);
- if(bm) FreeVec(ami_bitmap_get_icondata(bm));
+ if(bm) ami_bitmap_free_icondata(bm);
}
-----------------------------------------------------------------------
Summary of changes:
frontends/amiga/bitmap.c | 9 +++++----
frontends/amiga/bitmap.h | 10 +++++-----
frontends/amiga/icon.c | 2 +-
3 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/frontends/amiga/bitmap.c b/frontends/amiga/bitmap.c
index 7609d94..124c116 100644
--- a/frontends/amiga/bitmap.c
+++ b/frontends/amiga/bitmap.c
@@ -730,14 +730,15 @@ void ami_bitmap_set_title(struct bitmap *bm, const char
*title)
bm->title = strdup(title);
}
-ULONG *ami_bitmap_get_icondata(struct bitmap *bm)
+void ami_bitmap_set_icondata(struct bitmap *bm, ULONG *icondata)
{
- return bm->icondata;
+ bm->icondata = icondata;
}
-void ami_bitmap_set_icondata(struct bitmap *bm, ULONG *icondata)
+void ami_bitmap_free_icondata(struct bitmap *bm)
{
- bm->icondata = icondata;
+ if(bm->icondata) FreeVec(bm->icondata);
+ bm->icondata = NULL;
}
bool ami_bitmap_is_nativebm(struct bitmap *bm, struct BitMap *nbm)
diff --git a/frontends/amiga/bitmap.h b/frontends/amiga/bitmap.h
index 771ded4..a32d740 100755
--- a/frontends/amiga/bitmap.h
+++ b/frontends/amiga/bitmap.h
@@ -63,24 +63,24 @@ void ami_bitmap_set_url(struct bitmap *bm, struct nsurl
*url);
void ami_bitmap_set_title(struct bitmap *bm, const char *title);
/**
- * Get an icondata pointer
+ * Set an icondata pointer
*
* \param bm a bitmap, as returned by bitmap_create()
- * \return pointer to the icondata area
+ * \param icondata a pointer to memory
*
* This function probably shouldn't be here!
*/
-ULONG *ami_bitmap_get_icondata(struct bitmap *bm);
+void ami_bitmap_set_icondata(struct bitmap *bm, ULONG *icondata);
/**
- * Set an icondata pointer
+ * Free an icondata pointer
*
* \param bm a bitmap, as returned by bitmap_create()
* \param icondata a pointer to memory
*
* This function probably shouldn't be here!
*/
-void ami_bitmap_set_icondata(struct bitmap *bm, ULONG *icondata);
+void ami_bitmap_free_icondata(struct bitmap *bm);
/**
* Test if a BitMap is owned by a bitmap.
diff --git a/frontends/amiga/icon.c b/frontends/amiga/icon.c
index bd79a55..fd996ef 100644
--- a/frontends/amiga/icon.c
+++ b/frontends/amiga/icon.c
@@ -543,6 +543,6 @@ void amiga_icon_free(struct DiskObject *dobj)
struct bitmap *bm = dobj->do_Gadget.UserData;
FreeDiskObject(dobj);
- if(bm) FreeVec(ami_bitmap_get_icondata(bm));
+ if(bm) ami_bitmap_free_icondata(bm);
}
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org