diff options
author | Mattias Andrée <maandree@kth.se> | 2016-08-05 18:31:30 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2016-08-05 18:31:30 +0200 |
commit | 8b579db1a5b3023cbff8a1672d3625d726afd1d1 (patch) | |
tree | e329f44674700c2e5956d30b95bcfdff0db36e63 /src/servers | |
parent | Fix bugs (diff) | |
download | coopgammad-8b579db1a5b3023cbff8a1672d3625d726afd1d1.tar.gz coopgammad-8b579db1a5b3023cbff8a1672d3625d726afd1d1.tar.bz2 coopgammad-8b579db1a5b3023cbff8a1672d3625d726afd1d1.tar.xz |
Fix memory leak
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/servers')
-rw-r--r-- | src/servers/coopgamma.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/servers/coopgamma.c b/src/servers/coopgamma.c index d3e7f34..26b000d 100644 --- a/src/servers/coopgamma.c +++ b/src/servers/coopgamma.c @@ -157,6 +157,8 @@ static ssize_t add_filter(struct output* restrict out, struct filter* restrict f { filter_destroy(out->table_filters + i); out->table_filters[i] = *filter; + filter->class = NULL; + filter->ramps = NULL; return (ssize_t)i; } @@ -202,6 +204,8 @@ static ssize_t add_filter(struct output* restrict out, struct filter* restrict f return -1; out->table_filters[i] = *filter; + filter->class = NULL; + filter->ramps = NULL; return (ssize_t)i; } @@ -455,11 +459,11 @@ int handle_set_gamma(size_t conn, const char* restrict message_id, const char* r if ((r = add_filter(output, &filter)) < 0) goto fail; - filter.class = NULL; - filter.ramps = NULL; if (flush_filters(output, (size_t)r)) goto fail; + free(filter.class); + free(filter.ramps); return send_errno(0); fail: |