Signed-off-by: Dwight Engen <[email protected]>
---
src/lxc/confile.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/lxc/confile.c b/src/lxc/confile.c
index d0a404f..fbae861 100644
--- a/src/lxc/confile.c
+++ b/src/lxc/confile.c
@@ -782,12 +782,6 @@ static int config_network_ipv6_gateway(const char *key,
const char *value,
if (!netdev)
return -1;
- gw = malloc(sizeof(*gw));
- if (!gw) {
- SYSERROR("failed to allocate ipv6 gateway address");
- return -1;
- }
-
if (!value) {
ERROR("no ipv6 gateway address specified");
return -1;
@@ -797,6 +791,12 @@ static int config_network_ipv6_gateway(const char *key,
const char *value,
netdev->ipv6_gateway = NULL;
netdev->ipv6_gateway_auto = true;
} else {
+ gw = malloc(sizeof(*gw));
+ if (!gw) {
+ SYSERROR("failed to allocate ipv6 gateway address");
+ return -1;
+ }
+
if (!inet_pton(AF_INET6, value, gw)) {
SYSERROR("invalid ipv6 gateway address: %s", value);
free(gw);
--
1.8.1.4
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
_______________________________________________
Lxc-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lxc-devel