Review at  https://gerrit.osmocom.org/4689

sgsnemu: Free strings in error path

In create_pdp_conf(), we have to free() any strings both in the
success and in the error case.

Change-Id: If59cc8d6d151c123f46c1d029091209fd82b3c8e
Fixes: Coverity CID#187636, CID#187633
---
M sgsnemu/sgsnemu.c
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/89/4689/1

diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c
index 0b0fba6..c31f875 100644
--- a/sgsnemu/sgsnemu.c
+++ b/sgsnemu/sgsnemu.c
@@ -1459,9 +1459,9 @@
                                        "router advertisements; SLAAC will not 
suceed, please "
                                        "fix your setup!\n");
                        }
-                       free(accept_ra);
-                       free(forwarding);
                }
+               free(accept_ra);
+               free(forwarding);
        }
 
        ipset((struct iphash_t *)pdp->peer, &addr);

-- 
To view, visit https://gerrit.osmocom.org/4689
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If59cc8d6d151c123f46c1d029091209fd82b3c8e
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <[email protected]>

Reply via email to