diff --git a/src/tmpfiles.c b/src/tmpfiles.c index 20cafb96..5efdf7f1 100644 --- a/src/tmpfiles.c +++ b/src/tmpfiles.c @@ -108,6 +108,7 @@ static int glob_do(const char *path, int (*cb)(const char *)) for (size_t i = 0; i < gl.gl_pathc; i++) rc += cb(gl.gl_pathv[i]); + globfree(&gl); return rc; } @@ -1016,6 +1017,7 @@ static void tmpfiles(char *line) rc = fclose(fp); } } + globfree(&gl); break; case 'X': case 'x': @@ -1032,6 +1034,7 @@ static void tmpfiles(char *line) for (size_t i = 0; i < gl.gl_pathc; i++) systemf("restorecon %s %s", opts, gl.gl_pathv[i]); + globfree(&gl); break; default: errx(1, "Unsupported tmpfiles command '%s'", type);