rpc_client: talloc_stackframe() aborts on failure
authorVolker Lendecke <vl@samba.org>
Wed, 7 Apr 2021 15:45:18 +0000 (15:45 +0000)
committerJeremy Allison <jra@samba.org>
Mon, 19 Apr 2021 18:18:31 +0000 (18:18 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/rpc_client/cli_winreg.c

index caace6bef9b8d713cce1e9d91a5af386e5f41e90..a360d1eabcba6e354dfb210ed008170c670a6754 100644 (file)
@@ -711,7 +711,7 @@ NTSTATUS dcerpc_winreg_enumvals(TALLOC_CTX *mem_ctx,
                                        DATA_BLOB **pdata,
                                        WERROR *pwerr)
 {
-       TALLOC_CTX *tmp_ctx;
+       TALLOC_CTX *tmp_ctx = talloc_stackframe();
        uint32_t num_subkeys = 0, max_subkeylen = 0, max_classlen = 0;
        uint32_t num_values = 0, max_valnamelen = 0, max_valbufsize = 0;
        uint32_t secdescsize = 0;
@@ -727,14 +727,6 @@ NTSTATUS dcerpc_winreg_enumvals(TALLOC_CTX *mem_ctx,
        WERROR result = WERR_OK;
        NTSTATUS status;
 
-       tmp_ctx = talloc_stackframe();
-       if (tmp_ctx == NULL) {
-
-               status = NT_STATUS_NO_MEMORY;
-               *pwerr = ntstatus_to_werror(status);
-               return status;
-       }
-
        status = dcerpc_winreg_QueryInfoKey(h,
                                            tmp_ctx,
                                            key_hnd,