fix memory leak

This commit is contained in:
viandoxdev 2022-10-12 19:40:53 +02:00
parent 9aecac6010
commit 3b7f546d0d
No known key found for this signature in database
GPG Key ID: AF1410C5BC10AA25
3 changed files with 8 additions and 7 deletions

View File

@ -2,9 +2,8 @@ Q=@
CC=clang CC=clang
GCCCFLAGS=-Wno-format-truncation GCCCFLAGS=-Wno-format-truncation
CLANGCFLAGS=-fsanitize=memory CFLAGS=-std=c11 -pedantic -g -Wall -pthread -D_GNU_SOURCE -fsanitize=address
CFLAGS=-std=c11 -pedantic -g -Wall -pthread -D_GNU_SOURCE LDFLAGS=-lm -fsanitize=address
LDFLAGS=-lm -fsanitize=memory
BUILD_DIR=./objects BUILD_DIR=./objects
BIN=jsfw BIN=jsfw
@ -19,10 +18,6 @@ ifeq ($(CC),gcc)
CFLAGS:=$(CFLAGS) $(GCCCFLAGS) CFLAGS:=$(CFLAGS) $(GCCCFLAGS)
endif endif
ifeq ($(CC),clang)
CFLAGS:=$(CFLAGS) $(CLANGCFLAGS)
endif
.PHONY: run .PHONY: run
run: $(BIN) run: $(BIN)
@echo "RUN $(BIN) $(RUNARGS)" @echo "RUN $(BIN) $(RUNARGS)"

View File

@ -345,6 +345,8 @@ conn_end:
pthread_join(thread, NULL); pthread_join(thread, NULL);
} }
free(args); free(args);
vec_free(device_threads);
vec_free(device_controllers);
return NULL; return NULL;
} }

View File

@ -3,6 +3,10 @@
{ {
"filter": { "name": "SteelSeries SteelSeries Rival 310 eSports Mouse" }, "filter": { "name": "SteelSeries SteelSeries Rival 310 eSports Mouse" },
"tag": "Mouse" "tag": "Mouse"
},
{
"filter": { "name": "Logitech Gaming Mouse G502" },
"tag": "Mouse"
} }
], ],
"poll_interval": 1 "poll_interval": 1