diff options
author | Ben Pfaff <blp@ovn.org> | 2016-06-24 21:23:16 -0700 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2016-06-26 20:31:28 -0700 |
commit | 2225c0b9355e6823a2adccfeef2fb3fe3cccb557 (patch) | |
tree | 03d24cfb8f4d38cc82dc08f728e4a0d4dae809d6 /ofproto/ofproto-dpif-sflow.c | |
parent | 05e81316ca53077b97ecf56c32b24b99efe3e51e (diff) | |
download | openvswitch-2225c0b9355e6823a2adccfeef2fb3fe3cccb557.tar.gz |
util: New function nullable_xstrdup().
It's a pretty common pattern so create a function for it.
Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ofproto/ofproto-dpif-sflow.c')
-rw-r--r-- | ofproto/ofproto-dpif-sflow.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ofproto/ofproto-dpif-sflow.c b/ofproto/ofproto-dpif-sflow.c index 5d26b7c47..7d0aa36f0 100644 --- a/ofproto/ofproto-dpif-sflow.c +++ b/ofproto/ofproto-dpif-sflow.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. + * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Nicira, Inc. * Copyright (c) 2009 InMon Corp. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -115,8 +115,8 @@ ofproto_sflow_options_clone(const struct ofproto_sflow_options *old) { struct ofproto_sflow_options *new = xmemdup(old, sizeof *old); sset_clone(&new->targets, &old->targets); - new->agent_device = old->agent_device ? xstrdup(old->agent_device) : NULL; - new->control_ip = old->control_ip ? xstrdup(old->control_ip) : NULL; + new->agent_device = nullable_xstrdup(old->agent_device); + new->control_ip = nullable_xstrdup(old->control_ip); return new; } |