diff options
author | Thomas White <taw@physics.org> | 2019-09-03 15:27:24 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2019-09-03 15:29:34 +0200 |
commit | 9fb94994155948fdc7c1f3034e4e628bad32484d (patch) | |
tree | 135acc3c5abd7abdb1d2bd805c99035747577e77 /src/im-sandbox.c | |
parent | 628e263dce6ca70b06c60904d4de568b87a833f7 (diff) |
Fix memory leak in event queue
Diffstat (limited to 'src/im-sandbox.c')
-rw-r--r-- | src/im-sandbox.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/im-sandbox.c b/src/im-sandbox.c index 0ec20ea2..dacc2dbb 100644 --- a/src/im-sandbox.c +++ b/src/im-sandbox.c @@ -850,14 +850,16 @@ static int fill_queue(struct get_pattern_ctx *gpctx, struct sandbox *sb) while ( sb->shared->n_events < QUEUE_SIZE ) { struct filename_plus_event *ne; + char *evstr; ne = get_pattern(gpctx); if ( ne == NULL ) return 1; /* No more */ memset(sb->shared->queue[sb->shared->n_events], 0, MAX_EV_LEN); + evstr = get_event_string(ne->ev), snprintf(sb->shared->queue[sb->shared->n_events++], MAX_EV_LEN, - "%s %s %i", ne->filename, get_event_string(ne->ev), - sb->serial++); + "%s %s %i", ne->filename, evstr, sb->serial++); + free(evstr); sem_post(sb->queue_sem); free_filename_plus_event(ne); |