Correct error handling and add error message in ustcmd.c
[ust.git] / libustcmd / ustcmd.c
index 4248072b4705d0ca384982dcbd1acb2a68f4b01e..c51232000310340d81144ed8e6607c412a6b405a 100644 (file)
@@ -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;
        }
 
This page took 0.023887 seconds and 4 git commands to generate.