Added destroy command function
This commit is contained in:
@@ -72,3 +72,18 @@ static struct guestfs_inpsect_command *zmsg_to_command(zmsg_t *msg) {
|
|||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void command_destroy(struct guestfs_inpsect_command **c) {
|
||||||
|
free((*c)->name);
|
||||||
|
switch ((*c)->command) {
|
||||||
|
case GUESTFS_COMMAND_LS:
|
||||||
|
for (size_t i = 0; i < (*c)->args.ls.paths_length; i++) {
|
||||||
|
free((*c)->args.ls.paths[i]);
|
||||||
|
}
|
||||||
|
free((*c)->args.ls.paths);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
free(*c);
|
||||||
|
*c = NULL;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user