summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2014-10-25 12:37:01 +0200
committerSteven Barth <steven@midlink.org>2014-10-25 12:37:01 +0200
commit940e2141ab13727af6323c4d30002f785e466318 (patch)
treed9ce8302078d4cf46b0f1623b75a1acf3e9cb6fd
parentc52296c48abe2025abab03cea98f52a654b92ee2 (diff)
downloadodhcp6c-940e2141ab13727af6323c4d30002f785e466318.tar.gz
softwires: avoid unnecessary allocations
-rw-r--r--src/script.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/script.c b/src/script.c
index 98fc6e9..f350ea7 100644
--- a/src/script.c
+++ b/src/script.c
@@ -228,6 +228,9 @@ static void s46_to_env(enum odhcp6c_state state, const uint8_t *data, size_t len
const char *name = (state == STATE_S46_MAPE) ? "MAPE" :
(state == STATE_S46_MAPT) ? "MAPT" : "LW4O6";
+ if (len == 0)
+ return;
+
char *str;
size_t strsize;