diff options
author | Henrik Nord <[email protected]> | 2011-09-20 10:41:36 +0200 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2011-09-20 10:41:41 +0200 |
commit | 0309869320ec4dd7dc48827b9ec730ffccc3122e (patch) | |
tree | 2a1c95e9c416943b0eda216cc01436774cc882f9 /lib/erl_interface/src/registry/reg_restore.c | |
parent | f6f95cd980d515e730c64dde59997082d9979a53 (diff) | |
parent | ef757a19bdab06e29dcc29de32ef7b8202f2e68d (diff) | |
download | otp-0309869320ec4dd7dc48827b9ec730ffccc3122e.tar.gz otp-0309869320ec4dd7dc48827b9ec730ffccc3122e.tar.bz2 otp-0309869320ec4dd7dc48827b9ec730ffccc3122e.zip |
Merge branch 'cr/cppcheck' into dev
* cr/cppcheck:
Changes inspired by running cppcheck(1)
OTP-9557
Diffstat (limited to 'lib/erl_interface/src/registry/reg_restore.c')
-rw-r--r-- | lib/erl_interface/src/registry/reg_restore.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/erl_interface/src/registry/reg_restore.c b/lib/erl_interface/src/registry/reg_restore.c index 765c3f4314..7bc1c758af 100644 --- a/lib/erl_interface/src/registry/reg_restore.c +++ b/lib/erl_interface/src/registry/reg_restore.c @@ -303,6 +303,9 @@ int ei_reg_restore(int fd, ei_reg *reg, const char *mntab) if (mn_decode_insert(reg,msgbuf,&index,keybuf)) goto restore_failure; } + if (keybuf) free(keybuf); + if (dbuf) free(dbuf); + /* wait for unlink */ if (mn_unlink(fd)) return -1; @@ -310,8 +313,6 @@ int ei_reg_restore(int fd, ei_reg *reg, const char *mntab) ei_hash_foreach(reg->tab,clean_obj); /* success */ - if (keybuf) free(keybuf); - if (dbuf) free(dbuf); return 0; restore_failure: |