From: Nils Carlson Date: Fri, 10 Sep 2010 11:28:29 +0000 (+0200) Subject: Correct error handling and add error message in ustcmd.c X-Git-Tag: v0.8~20 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=dc46f6e66144edead3c54d69eaa0b4bec56e4eaf;p=ust.git Correct error handling and add error message in ustcmd.c Signed-off-by: Nils Carlson Acked-by: Douglas Santos --- diff --git a/libustcmd/ustcmd.c b/libustcmd/ustcmd.c index 4248072..c512320 100644 --- a/libustcmd/ustcmd.c +++ b/libustcmd/ustcmd.c @@ -395,10 +395,6 @@ int ustcmd_get_cmsf(struct marker_status **cmsf, const pid_t pid) return -1; } result = ustcmd_send_cmd("list_markers", pid, &big_str); - if (result != 1) { - return -1; - } - if (result != 1) { ERR("error while getting markers list"); return -1; @@ -407,6 +403,7 @@ int ustcmd_get_cmsf(struct marker_status **cmsf, const pid_t pid) tmp_cmsf = (struct marker_status *) malloc(sizeof(struct marker_status) * (ustcmd_count_nl(big_str) + 1)); if (tmp_cmsf == NULL) { + ERR("Failed to allocate CMSF array"); return -1; }