daemon_config.cc: add some more asserts

Add assert checks for some more set_val() calls to fix cppcheck issue
"Variable 'ret' is reassigned a value before the old one has been used"

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
common/addr_parsing.c: fix realloc memory leak

Fix handling of realloc. If realloc() fails it returns NULL, assigning
the return value of realloc() directly to the pointer without checking
for the result will lead to a memory leak in error case.

Use a temporary pointer to hold the result of realloc(). In error case
print error and exit, otherwise assign it to the pointer we want to realloc.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
test/librbd/fsx.c: fix gcc warning

Initialize pointer with NULL before call posix_memalign() to fix
gcc warning:

test/librbd/fsx.c:1402:13: warning: ‘temp_buf’ may be used
 uninitialized in this function [-Wmaybe-uninitialized]
  if ((ret = ops->read(&cur_ctx, 0, file_info.st_size, temp_buf)) < 0) {
             ^
test/librbd/fsx.c:1398:13: warning: ‘good_buf’ may be used
 uninitialized in this function [-Wmaybe-uninitialized]
  if ((ret = pread(fd, good_buf, file_info.st_size, 0)) < 0) {

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
librbd/internal.cc: check earlier for null pointer

Fix potential null ponter deref, move check for 'order != NULL'
to the beginning of the function to prevent a) deref in ldout() call
and b) to leave function as early as possible if check fails.

[src/librbd/internal.cc:843] -> [src/librbd/internal.cc:865]: (warning)
 Possible null pointer dereference: order - otherwise it is redundant
 to check it against null.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
os/KeyValueStore.cc: fix possible null pointer deref warning

Add assert check for header->header and remove redundant 'if'
check for header again later.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
MemStore.cc: silence gcc -Wunused-variable

Don't assign return value of i.get_length() to a variable until
they are really used. Added comment on what is the intention of
the variables.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
KeyValueStore.cc: silence gcc -Wunused-variable

Don't assign return value of i.get_length() to a variable until
they are really used. Added comment on what is the intention of
the variables.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
JournalScanner.cc: catch exception by reference

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
kv_flat_btree_async.cc: remove consecutive break after return

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Merge pull request #1918 from ceph/wip-da-SCA-20140604

Some new fixes for gcc and cppcheck warnings/issues

Reviewed-by: Sage Weil <sage@inktank.com>
Merge remote-tracking branches 'origin/wip-7999', 'origin/wip-8396', 'origin/wip-8438', 'upstream/next' and 'origin/wip-8507' into wip-sam-testing