From f57c098056bafb172ddf126de6ae3590a7f3b81e Mon Sep 17 00:00:00 2001 From: Nguyen Anh Quynh Date: Sat, 28 Nov 2015 15:56:19 +0800 Subject: [PATCH] declare variables at begin of function --- uc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/uc.c b/uc.c index 3ec5951a..d730f509 100644 --- a/uc.c +++ b/uc.c @@ -628,10 +628,11 @@ uc_err uc_mem_map(uc_engine *uc, uint64_t address, size_t size, uint32_t perms) UNICORN_EXPORT uc_err uc_mem_map_ptr(uc_engine *uc, uint64_t address, size_t size, void *ptr) { + uc_err err; + if (ptr == NULL) return UC_ERR_ARG; - uc_err err; if ((err = mem_map_start(uc, address, size, UC_PROT_ALL)) != UC_ERR_OK) return err;