all repos — tint2 @ 2857b96c4d37c88ca31708e665b13b13ff1acc83

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

Fixed memory leak in icon loading
o9000 mrovi9000@gmail.com
commit

2857b96c4d37c88ca31708e665b13b13ff1acc83

parent

8b08930268d900a7a00d580e75a5f4613e010611

3 files changed, 7 insertions(+), 5 deletions(-)

jump to
M src/util/cache.csrc/util/cache.c

@@ -86,6 +86,8 @@ continue;

if (parse_line(line, &key, &value)) { g_hash_table_insert(cache->_table, g_strdup(key), g_strdup(value)); + free(key); + free(value); } } free(line);
M src/util/common.csrc/util/common.c

@@ -73,15 +73,15 @@ fclose(file_dest);

fclose(file_src); } -int parse_line(const char *line, char **key, char **value) +gboolean parse_line(const char *line, char **key, char **value) { char *a, *b; /* Skip useless lines */ if ((line[0] == '#') || (line[0] == '\n')) - return 0; + return FALSE; if (!(a = strchr(line, '='))) - return 0; + return FALSE; /* overwrite '=' with '\0' */ a[0] = '\0';

@@ -96,7 +96,7 @@ *value = strdup(a);

g_strstrip(*key); g_strstrip(*value); - return 1; + return TRUE; } void tint_exec(const char *command)
M src/util/common.hsrc/util/common.h

@@ -48,7 +48,7 @@ // Parses lines with the format 'key = value' into key and value.

// Strips key and value. // Values may contain spaces and the equal sign. // Returns 1 if both key and value could be read, zero otherwise. -int parse_line(const char *line, char **key, char **value); +gboolean parse_line(const char *line, char **key, char **value); void extract_values(const char *value, char **value1, char **value2, char **value3);