From 3d7511210b065169fdc4d87471d24459ccb46eff Mon Sep 17 00:00:00 2001 From: Anchit Narang Date: Thu, 30 Jul 2015 12:01:59 +0530 Subject: [PATCH] tools/rctest: Fixed memory leak Removed dynamic allocation of filename and savefile by strdup. Instead filename and savefile are directly pointing to the argv element. --- tools/rctest.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/rctest.c b/tools/rctest.c index bdc1eb56e..383d165e5 100644 --- a/tools/rctest.c +++ b/tools/rctest.c @@ -80,8 +80,8 @@ static bdaddr_t auto_bdaddr; static uint16_t uuid = 0x0000; static uint8_t channel = 10; -static char *filename = NULL; -static char *savefile = NULL; +static const char *filename = NULL; +static const char *savefile = NULL; static int save_fd = -1; static int master = 0; @@ -798,11 +798,11 @@ int main(int argc, char *argv[]) break; case 'B': - filename = strdup(optarg); + filename = optarg; break; case 'O': - savefile = strdup(optarg); + savefile = optarg; break; case 'N': -- 2.47.3