aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2018-10-24 10:39:15 -0700
committerPaul Vinciguerra <pvinci@vinciconsulting.com>2018-10-24 10:39:15 -0700
commita0f0c964049d16155a49ef4cf986a16c34acfaec (patch)
tree897403e2e7f818ee2ef367f057452bedeb964688 /src
parent3d3b9550dbee81d3cca85c593015edf2ac3191c2 (diff)
Trivial: vpp/vnet/main.c fix resource leak
Change-Id: Ia6cadec8117d2cc35c9329910bb403bcd1b048ce Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'src')
-rw-r--r--src/vpp/vnet/main.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/vpp/vnet/main.c b/src/vpp/vnet/main.c
index db28662de4c..89dfedcd015 100644
--- a/src/vpp/vnet/main.c
+++ b/src/vpp/vnet/main.c
@@ -155,10 +155,17 @@ main (int argc, char *argv[])
}
argv_ = calloc (1, sizeof (char *));
if (argv_ == NULL)
- return 1;
+ {
+ fclose (fp);
+ return 1;
+ }
arg = strndup (argv[0], 1024);
if (arg == NULL)
- return 1;
+ {
+ fclose (fp);
+ free (argv_);
+ return 1;
+ }
argv_[0] = arg;
while (1)