From 42cc5032d52d8760b2aee5d923b809165ef7d7c7 Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Wed, 4 Jan 2023 17:26:34 +0000 Subject: [PATCH] Fix a memory leak in set_from() Free the allocated 'sender' string when returning NULL on error. --- dma.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dma.c b/dma.c index ae0018a..c314eb7 100644 --- a/dma.c +++ b/dma.c @@ -126,6 +126,7 @@ set_from(struct queue *queue, const char *osender) } if (strchr(sender, '\n') != NULL) { + free(sender); errno = EINVAL; return (NULL); }