X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=liblttng-ust%2Flttng-ust-comm.c;h=682992ca3d46fe719a8b22cfb761fd86ea47fa70;hb=ab89263ef2f50399e608e74557900aa0a3165a61;hp=69bce955491db27da8b3c8818da605f9a50a6f5d;hpb=e9fe6aad66010614f987e917866837706d19053b;p=deliverable%2Flttng-ust.git diff --git a/liblttng-ust/lttng-ust-comm.c b/liblttng-ust/lttng-ust-comm.c index 69bce955..682992ca 100644 --- a/liblttng-ust/lttng-ust-comm.c +++ b/liblttng-ust/lttng-ust-comm.c @@ -772,7 +772,7 @@ static int handle_bytecode_recv(struct sock_info *sock_info, int sock, struct ustcomm_ust_msg *lum) { - struct lttng_ust_bytecode_node *bytecode; + struct lttng_ust_bytecode_node *bytecode = NULL; enum lttng_ust_bytecode_node_type type; const struct lttng_ust_objd_ops *ops; uint32_t data_size, data_size_max, reloc_offset; @@ -829,7 +829,7 @@ int handle_bytecode_recv(struct sock_info *sock_info, switch (len) { case 0: /* orderly shutdown */ ret = 0; - goto error_free_bytecode; + goto end; default: if (len == bytecode->bc.len) { DBG("Bytecode %s data received", @@ -842,41 +842,33 @@ int handle_bytecode_recv(struct sock_info *sock_info, ERR("%s remote end closed connection", sock_info->name); ret = len; - goto error_free_bytecode; + goto end; } ret = len; - goto error_free_bytecode; + goto end; } else { DBG("Incorrect %s bytecode data message size: %zd", bytecode_type_str(lum->cmd), len); ret = -EINVAL; - goto error_free_bytecode; + goto end; } } ops = objd_ops(lum->handle); if (!ops) { ret = -ENOENT; - goto error_free_bytecode; + goto end; } - if (ops->cmd) { + if (ops->cmd) ret = ops->cmd(lum->handle, lum->cmd, - (unsigned long) bytecode, + (unsigned long) &bytecode, NULL, sock_info); - if (ret) - goto error_free_bytecode; - /* don't free bytecode if everything went fine. */ - } else { + else ret = -ENOSYS; - goto error_free_bytecode; - } - - goto end; -error_free_bytecode: - free(bytecode); end: + free(bytecode); return ret; }