xentrace: free CPU mask string before overwriting pointer

While multiple -c options may be unexpected, we'd still better deal with
them properly.

Also restore the blank line that was bogusly zapped by the same commit.

Coverity-ID: 1638723
Fixes: e4ad283684 ("xentrace: Implement cpu mask range parsing of human values (-c)")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Anthony PERARD <anthony.perard@vates.tech>
Release-Acked-by: Oleksii Kurochko<oleksii.kurochko@gmail.com>
This commit is contained in:
Jan Beulich committed 2025-01-17 08:53:27 +01:00
1 parent a29a1fb5a5
commit c33e14abb1
1 file changed
+2
+2
View File
@@ -1105,8 +1105,10 @@ static void parse_args(int argc, char **argv)
break;
case 'c': /* set new cpu mask for filtering (when xch is set). */
free(opts.cpu_mask_str);
opts.cpu_mask_str = strdup(optarg);
break;
case 'e': /* set new event mask for filtering*/
parse_evtmask(optarg);
break;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.