Attention is currently required from: Angel Pons, Anastasia Klimchuk.
Patch set 7:Code-Review +2
1 comment:
File layout.c:
Patch Set #7, Line 123: char *file = NULL; /* file is optional, so defaults to NULL */
(consider this comment to be a non-blocking nit since the code is fine as you've written it and Edward already suggested a better refactoring idea)
Without this initialization `file` could get free()'d with a garbage value. For extra safety on top of the initialization, you might try using different labels so the program flow will skip freeing pointers that are simply unused, initialized or not. For example:
```
if (colon) {
name = strndup(...);
if (!name) {
...
goto error_1;
}
file = strndup(...);
if (!file) {
...
goto error_2;
}
}
...
error_2:
free(file);
error_1:
free(name);
return 1;
```
To view, visit change 70006. To unsubscribe, or for help writing mail filters, visit settings.