Skip to content

Commit c25fd43

Browse files
committed
Added free of dir_name in oscap_acquire_guess_realpath.
Unlike dirname, oscap_dirname allocates space for the result on the heap.
1 parent 5d4bbad commit c25fd43

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/common/oscap_acquire.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ char *oscap_acquire_guess_realpath(const char *filepath)
368368
if (real_dir == NULL) {
369369
oscap_seterr(OSCAP_EFAMILY_OSCAP, "Cannot guess realpath for %s, directory: %s does not exists!", filepath, dir_name);
370370
free(copy);
371+
free(dir_name);
371372
return NULL;
372373
}
373374
free(dir_name);

0 commit comments

Comments
 (0)