diff options
author | Sumit Bose <sbose@redhat.com> | 2009-05-20 12:08:13 +0200 |
---|---|---|
committer | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2009-05-21 11:22:21 +1000 |
commit | 2fcedf6dac9dd275adbb0017e53547614df29d93 (patch) | |
tree | 94a290c1514cd2446139e31a6403466018355f73 /ctdb/tests | |
parent | 11988fc77a06c50c251acec1dc8cc2c275f68310 (diff) | |
download | samba-2fcedf6dac9dd275adbb0017e53547614df29d93.tar.gz samba-2fcedf6dac9dd275adbb0017e53547614df29d93.tar.xz samba-2fcedf6dac9dd275adbb0017e53547614df29d93.zip |
add missing checks on so far ignored return values
Most of these were found during a review by Jim Meyering <meyering@redhat.com>
(This used to be ctdb commit 3aee5ee1deb4a19be3bd3a4ce3abbe09de763344)
Diffstat (limited to 'ctdb/tests')
-rw-r--r-- | ctdb/tests/src/ctdb_persistent.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ctdb/tests/src/ctdb_persistent.c b/ctdb/tests/src/ctdb_persistent.c index 8f0452abad..325b378ffa 100644 --- a/ctdb/tests/src/ctdb_persistent.c +++ b/ctdb/tests/src/ctdb_persistent.c @@ -71,6 +71,7 @@ static void check_counters(struct ctdb_context *ctdb, TDB_DATA data) { int i; uint32_t *counters, *old_counters; + unsigned char *tmp_dptr; counters = (uint32_t *)data.dptr; old_counters = (uint32_t *)old_data.dptr; @@ -86,7 +87,14 @@ static void check_counters(struct ctdb_context *ctdb, TDB_DATA data) if (old_data.dsize != data.dsize) { old_data.dsize = data.dsize; - old_data.dptr = talloc_realloc_size(ctdb, old_data.dptr, old_data.dsize); + tmp_dptr = talloc_realloc_size(ctdb, old_data.dptr, old_data.dsize); + if (tmp_dptr == NULL) { + printf("[%4u] ERROR: talloc_realloc_size failed.\n", getpid()); + success = false; + return; + } else { + old_data.dptr = tmp_dptr; + } } memcpy(old_data.dptr, data.dptr, data.dsize); |