Attention is currently required from: Felix Singer, Edward O'Callaghan, Angel Pons.
4 comments:
File layout.c:
Patch Set #2, Line 139: || file == NULL
Line 144 causes a memory leak now. […]
Oh yes, thanks for spotting memory leak! I missed that, fixed by `goto error`.
The option you said prefer (moving the code) does not compile, I tried that at some point earlier locally (between patchset 2 and 3), the reason is:
```
../layout.c: In function ‘register_include_arg’:
../layout.c:170:9: error: ‘name’ may be used uninitialized [-Werror=maybe-uninitialized]
170 | free(name);
| ^~~~~~~~~~
```
(line number might be out of date).
Handling the `name` first, `file` second solves the issue. This also means all error paths (for name, file and below) are treated by `goto error`, looks nice and consistent.
File layout.c:
Patch Set #3, Line 135: if (name == NULL) {
nit: `!name`
Done
Patch Set #3, Line 142: if(!colon[1]) {
mising space `if (`
Done
Patch Set #3, Line 148: if (file == NULL) {
nit: `!file`
Done
To view, visit change 70006. To unsubscribe, or for help writing mail filters, visit settings.