~sircmpwn/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
3 2

[PATCH fdicons 1/3] Prevent crash when destroying NULL database

Tom Lebreux
Details
Message ID
<20200221140247.2318723-1-tomlebreux@cock.li>
DKIM signature
pass
Download raw message
Patch: +3 -0
---
 src/database.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/database.c b/src/database.c
index a2d053f2a9a6..de7ffff341d1 100644
--- a/src/database.c
+++ b/src/database.c
@@ -409,6 +409,9 @@ fd_icon_theme_destroy(struct fd_icon_theme *themes)
void
fd_icon_database_destroy(struct fd_icon_database *database)
{
	if (!database) {
		return;
	}
	fd_icon_theme_destroy(database->themes);
	free(database->default_theme);
	free(database);
-- 
2.25.0

[PATCH fdicons 2/3] Fix memory leak with fd_icon_database_get_icon

Tom Lebreux
Details
Message ID
<20200221140247.2318723-2-tomlebreux@cock.li>
In-Reply-To
<20200221140247.2318723-1-tomlebreux@cock.li> (view parent)
DKIM signature
pass
Download raw message
Patch: +4 -1
---
 src/lookup.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/lookup.c b/src/lookup.c
index a50033e6b11f..c7bc8eccee6e 100644
--- a/src/lookup.c
+++ b/src/lookup.c
@@ -224,7 +224,10 @@ fd_icon_database_get_icon(struct fd_icon_database *database, int size, ...)
	va_end(ap);
	criteria.names[i] = NULL;

	return fd_icon_database_get_icon_criteria(database, &criteria);
	struct fd_icon *icon =
		fd_icon_database_get_icon_criteria(database, &criteria);
	free(criteria.names);
	return icon;
}

void
-- 
2.25.0

[PATCH fdicons 3/3] Fix fd_icon_destroy leaking attach points

Tom Lebreux
Details
Message ID
<20200221140247.2318723-3-tomlebreux@cock.li>
In-Reply-To
<20200221140247.2318723-1-tomlebreux@cock.li> (view parent)
DKIM signature
pass
Download raw message
Patch: +11 -1
---
 src/lookup.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/lookup.c b/src/lookup.c
index c7bc8eccee6e..9a27a42479ac 100644
--- a/src/lookup.c
+++ b/src/lookup.c
@@ -230,6 +230,16 @@ fd_icon_database_get_icon(struct fd_icon_database *database, int size, ...)
	return icon;
}

static void
fd_icon_attach_point_destroy(struct fd_icon_attach_point *attach_points)
{
	while (attach_points) {
		struct fd_icon_attach_point *next = attach_points->next;
		free(attach_points);
		attach_points = next;
	}
}

void
fd_icon_destroy(struct fd_icon *icon)
{
@@ -239,6 +249,6 @@ fd_icon_destroy(struct fd_icon *icon)
	free(icon->path);
	free(icon->name);
	free(icon->display_name);
	/* TODO: Free the rest */
	fd_icon_attach_point_destroy(icon->attach_points);
	free(icon);
}
-- 
2.25.0

Re: [PATCH fdicons 3/3] Fix fd_icon_destroy leaking attach points

Details
Message ID
<C0RX8KBYTVUC.381YHXYPNVERL@homura>
In-Reply-To
<20200221140247.2318723-3-tomlebreux@cock.li> (view parent)
DKIM signature
pass
Download raw message
Thanks! I pushed all five of your patches:

To gitlab.freedesktop.org:ddevault/fdicons
   47d4c41..633d8b8  master -> master
Review patch Export thread (mbox)