diff options
author | Stefan Metzmacher <metze@samba.org> | 2016-11-08 09:18:52 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2016-11-23 16:53:28 +0100 |
commit | e369d800ba64a4047787afd0b416f7d26cfd33f4 (patch) | |
tree | dc8d5f5620b16744212d7ce7c944d7d47bfe3333 | |
parent | 28fbc5ea2e39bf23808aee5035cfc2f58b7fbcfd (diff) | |
download | samba-e369d800ba64a4047787afd0b416f7d26cfd33f4.tar.gz |
pyldb: protect PyErr_LDB_ERROR_IS_ERR_RAISE() with do {} while(0)
This should avoid the following warning:
CID 1394274: Control flow issues (DEADCODE)
Execution cannot reach this statement: ";".
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r-- | lib/ldb/pyldb.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/ldb/pyldb.h b/lib/ldb/pyldb.h index e0cce1e89d2..4fc89ec4814 100644 --- a/lib/ldb/pyldb.h +++ b/lib/ldb/pyldb.h @@ -95,11 +95,12 @@ typedef struct { struct ldb_control *data; } PyLdbControlObject; -#define PyErr_LDB_ERROR_IS_ERR_RAISE(err,ret,ldb) \ +#define PyErr_LDB_ERROR_IS_ERR_RAISE(err,ret,ldb) do { \ if (ret != LDB_SUCCESS) { \ PyErr_SetLdbError(err, ret, ldb); \ return NULL; \ - } + } \ +} while(0) /* Picked out of thin air. To do this properly, we should probably have some part of the * errors in LDB be allocated to bindings ? */ |