summaryrefslogtreecommitdiffstats
path: root/src/erec.c
diff options
context:
space:
mode:
authorEric Leblond <eric@regit.org>2017-07-11 00:32:54 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2017-07-17 17:20:34 +0200
commit4223878982af3efd924691bb9721cdf32862d0b7 (patch)
treeae4de085eb2478f2d8fd2a669685e39a6f3030cc /src/erec.c
parent0fdb267c521ea8717fcd5cd1ddf38fc5b0e9c725 (diff)
scanner: free filename when destroying scanner
To be able to do so we duplicate the name in the indesc if it is set. Signed-off-by: Eric Leblond <eric@regit.org> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/erec.c')
-rw-r--r--src/erec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/erec.c b/src/erec.c
index eacdd97a..439add97 100644
--- a/src/erec.c
+++ b/src/erec.c
@@ -39,6 +39,8 @@ static void input_descriptor_destroy(const struct input_descriptor *indesc)
indesc->location.indesc->type != INDESC_INTERNAL) {
input_descriptor_destroy(indesc->location.indesc);
}
+ if (indesc->name)
+ xfree(indesc->name);
xfree(indesc);
}
@@ -53,6 +55,9 @@ static struct input_descriptor *input_descriptor_dup(const struct input_descript
indesc->location.indesc->type != INDESC_INTERNAL)
dup_indesc->location.indesc = input_descriptor_dup(indesc->location.indesc);
+ if (indesc->name)
+ dup_indesc->name = xstrdup(indesc->name);
+
return dup_indesc;
}