]> git.proxmox.com Git - ovs.git/commitdiff
dpctl: Fix memory leak on error path.
authorBen Pfaff <blp@ovn.org>
Tue, 30 May 2017 14:38:18 +0000 (07:38 -0700)
committerBen Pfaff <blp@ovn.org>
Tue, 30 May 2017 16:39:24 +0000 (09:39 -0700)
Found by Coverity.

Reported-at: https://scan3.coverity.com/reports.htm#v16889/p10449/fileInstanceId=14762909&defectInstanceId=4305311&mergedDefectId=180415
Signed-off-by: Ben Pfaff <blp@ovn.org>
lib/dpctl.c

index 11be85706db5f1ac676067ae53a20b829fac8a80..71bd383201f8ab4faaeae0ac8c0f83ad55492410 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Nicira, Inc.
+ * Copyright (c) 2008-2017 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -806,6 +806,7 @@ dpctl_dump_flows(int argc, const char *argv[], struct dpctl_params *dpctl_p)
                                          &names_portno);
         if (err) {
             dpctl_error(dpctl_p, 0, "Failed to parse filter (%s)", err);
+            free(err);
             error = EINVAL;
             goto out_dpifclose;
         }