diff --git a/librpc/ndr/ndr_basic.c b/librpc/ndr/ndr_basic.c index 5c717e69858..0811a590971 100644 --- a/librpc/ndr/ndr_basic.c +++ b/librpc/ndr/ndr_basic.c @@ -781,9 +781,13 @@ _PUBLIC_ enum ndr_err_code ndr_push_full_ptr(struct ndr_push *ndr, const void *p /* Check if the pointer already exists and has an id */ ptr = ndr_token_peek(&ndr->full_ptr_list, p); if (ptr == 0) { + enum ndr_err_code ret = NDR_ERR_SUCCESS; ndr->ptr_count++; ptr = ndr->ptr_count; - ndr_token_store(ndr, &ndr->full_ptr_list, p, ptr); + ret = ndr_token_store(ndr, &ndr->full_ptr_list, p, ptr); + if (ret != NDR_ERR_SUCCESS) { + return ret; + } } } return ndr_push_uint3264(ndr, NDR_SCALARS, ptr);