projects
/
lttngtop.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Free the filename on sys_close
[lttngtop.git]
/
src
/
iostreamtop.c
diff --git
a/src/iostreamtop.c
b/src/iostreamtop.c
index f20fcecd81ec752a88b6ddf25559ab82d752aa81..f3fef7b25ea97043dfc8f89949fb3bbf05556811 100644
(file)
--- a/
src/iostreamtop.c
+++ b/
src/iostreamtop.c
@@
-48,7
+48,8
@@
void add_file(struct processtop *proc, struct files *file, int fd)
if (tmp_file == NULL)
g_ptr_array_index(proc->process_files_table, fd) = file;
else {
if (tmp_file == NULL)
g_ptr_array_index(proc->process_files_table, fd) = file;
else {
- if (strcmp(tmp_file->name, file->name) != 0) {
+ if (!tmp_file->name ||
+ strcmp(tmp_file->name, file->name) != 0) {
size = proc->process_files_table->len;
g_ptr_array_set_size(proc->process_files_table,
size+1);
size = proc->process_files_table->len;
g_ptr_array_set_size(proc->process_files_table,
size+1);
@@
-139,6
+140,10
@@
void close_file(struct processtop *proc, int fd)
if (file != NULL) {
file->flag = __NR_close;
lttngtop.nbfiles--;
if (file != NULL) {
file->flag = __NR_close;
lttngtop.nbfiles--;
+ if (file->name) {
+ free(file->name);
+ file->name = NULL;
+ }
}
lttngtop.nbclosedfiles++;
}
}
lttngtop.nbclosedfiles++;
}
This page took
0.022209 seconds
and
4
git commands to generate.