librc: fix 'init' memory leak

From scan-build w/ clang-16.0.0_pre20230107:
```
../src/librc/librc.c:759:14: warning: Potential leak of memory pointed to by 'init' [unix.Malloc]
                                                return false;
                                                       ^~~~~
```
This commit is contained in:
Sam James 2023-01-25 03:47:10 +00:00 committed by Mike Frysinger
parent 9f227e8b49
commit d6a5264a9d

View File

@ -755,8 +755,10 @@ rc_service_mark(const char *service, const RC_SERVICE state)
RC_SVCDIR "/%s/%s",
rc_parse_service_state(RC_SERVICE_WASINACTIVE),
base);
if (symlink(init, was) == -1)
if (symlink(init, was) == -1) {
free(init);
return false;
}
skip_wasinactive = true;
}
if (unlink(file) == -1) {