Address splint warnings about setting and clearing state->control.name (#165).
This commit is contained in:
@@ -494,7 +494,7 @@ struct pvwatchfd_s {
|
||||
char file_fd[PV_SIZEOF_FILE_FD]; /* path to /proc fd symlink */
|
||||
#endif
|
||||
char file_fdpath[PV_SIZEOF_FILE_FDPATH]; /* path to file that was opened */
|
||||
char display_name[PV_SIZEOF_DISPLAY_NAME]; /* name to show on progress bar */
|
||||
/*@keep@ */ char display_name[PV_SIZEOF_DISPLAY_NAME]; /* name to show on progress bar */
|
||||
struct stat sb_fd; /* stat of fd symlink */
|
||||
struct stat sb_fd_link; /* lstat of fd symlink */
|
||||
off_t size; /* size of whole file, 0 if unknown */
|
||||
|
||||
@@ -1003,7 +1003,14 @@ int pv_watchpid_loop(pvstate_t state)
|
||||
&(state->control), &(info_array[idx].state->flags),
|
||||
&(info_array[idx].state->transfer), &(info_array[idx].state->calc),
|
||||
&(state->cursor), &(info_array[idx].state->display), NULL, false);
|
||||
/*@-mustfreeonly@ */
|
||||
state->control.name = NULL;
|
||||
/*
|
||||
* splint warns of a memory leak, but we'd
|
||||
* set name to be an alias of display_name,
|
||||
* so nothing is lost here.
|
||||
*/
|
||||
/*@+mustfreeonly@ */
|
||||
displayed_lines++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user