[ovs-dev] [PATCH 3/3] Fix memory leak in nbctl_lr_route_del.

nickcooper-zhangtonghao nickcooper-zhangtonghao at opencloud.tech
Mon Oct 3 17:52:02 UTC 2016


Signed-off-by: nickcooper-zhangtonghao <nickcooper-zhangtonghao at opencloud.tech>
---
 ovn/utilities/ovn-nbctl.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c
index 179c9eb..3f31047 100644
--- a/ovn/utilities/ovn-nbctl.c
+++ b/ovn/utilities/ovn-nbctl.c
@@ -1699,7 +1699,10 @@ nbctl_lr_route_del(struct ctl_context *ctx)
     }
 
     if (!shash_find(&ctx->options, "--if-exists")) {
-        ctl_fatal("no matching prefix: %s", prefix);
+        char errm[60];
+        snprintf(errm, sizeof errm, "no matching prefix: %s", prefix);
+        free(prefix);
+        ctl_fatal("%s", errm);
     }
     free(prefix);
 }
-- 
1.8.3.1







More information about the dev mailing list