dbwrap: don't ignore the result of dbwrap_parse_record in dbwrap_fetch_int32()
authorStefan Metzmacher <metze@samba.org>
Fri, 22 Jun 2012 13:10:00 +0000 (15:10 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 22 Jun 2012 15:10:52 +0000 (17:10 +0200)
metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Jun 22 17:10:52 CEST 2012 on sn-devel-104

lib/dbwrap/dbwrap_util.c

index 84520707829f61d45baa4138a1193969d0ba61a6..119c7e1137433c5bec751a54633e457039e041b1 100644 (file)
@@ -49,6 +49,7 @@ NTSTATUS dbwrap_fetch_int32(struct db_context *db, TDB_DATA key,
                            int32_t *result)
 {
        struct dbwrap_fetch_int32_state state;
+       NTSTATUS status;
 
        if (result == NULL) {
                return NT_STATUS_INVALID_PARAMETER;
@@ -56,7 +57,10 @@ NTSTATUS dbwrap_fetch_int32(struct db_context *db, TDB_DATA key,
 
        state.status = NT_STATUS_INTERNAL_ERROR;
 
-       dbwrap_parse_record(db, key, dbwrap_fetch_int32_parser, &state);
+       status = dbwrap_parse_record(db, key, dbwrap_fetch_int32_parser, &state);
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
 
        if (NT_STATUS_IS_OK(state.status)) {
                *result = state.result;