mirror of https://github.com/xzeldon/htop.git
Memory leak on DragonFlyBSD when querying full command line
This commit is contained in:
parent
57c1538887
commit
9d8d87e1d5
|
@ -333,6 +333,7 @@ static void DragonFlyBSDProcessList_updateProcessName(kvm_t* kd, const struct ki
|
||||||
}
|
}
|
||||||
|
|
||||||
char* cmdline = xMalloc(len);
|
char* cmdline = xMalloc(len);
|
||||||
|
|
||||||
char* at = cmdline;
|
char* at = cmdline;
|
||||||
int end = 0;
|
int end = 0;
|
||||||
for (int i = 0; argv[i]; i++) {
|
for (int i = 0; argv[i]; i++) {
|
||||||
|
@ -346,6 +347,8 @@ static void DragonFlyBSDProcessList_updateProcessName(kvm_t* kd, const struct ki
|
||||||
*at = '\0';
|
*at = '\0';
|
||||||
|
|
||||||
Process_updateCmdline(proc, cmdline, 0, end);
|
Process_updateCmdline(proc, cmdline, 0, end);
|
||||||
|
|
||||||
|
free(cmdline);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void DragonFlyBSDProcessList_scanJails(DragonFlyBSDProcessList* dfpl) {
|
static inline void DragonFlyBSDProcessList_scanJails(DragonFlyBSDProcessList* dfpl) {
|
||||||
|
|
Loading…
Reference in New Issue