Skip to content

Commit 5b056bb

Browse files
committed
Improve the readability of code
1 parent c4fe009 commit 5b056bb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/OVAL/probes/unix/linux/inetlisteningservers_probe.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,11 @@ static int collect_process_info(llist *l)
263263
pathname_len++; // +1 for terminating '\0'
264264
char *pathname = malloc(pathname_len);
265265
snprintf(pathname, pathname_len, "%s/%s", buf, ent->d_name);
266-
if ((lnlen = readlink(pathname, line, sizeof(line) - 1)) < 0) {
267-
free(pathname);
266+
lnlen = readlink(pathname, line, sizeof(line) - 1);
267+
free(pathname);
268+
if (lnlen < 0) {
268269
continue;
269270
}
270-
free(pathname);
271271
line[lnlen] = 0;
272272

273273
// Only look at the socket entries

0 commit comments

Comments
 (0)