1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-25 01:02:24 +00:00

resolve an issue found by cppcheck:

[unix/osxlaunch.c:133] -> [unix/osxlaunch.c:134]: (warning) Either the condition '!qhead' is redundant or there is possible null pointer dereference: qhead.
This commit is contained in:
Ilya Shipitsin 2017-06-19 20:57:28 +05:00
parent 892d4a0188
commit 4387b5f161

View File

@ -130,11 +130,11 @@ char *get_unused_env_prefix(void)
char **e;
qhead = (struct bucket *)malloc(sizeof(struct bucket));
qhead->prefixlen = 0;
if (!qhead) {
fprintf(stderr, "out of memory\n");
exit(1);
}
qhead->prefixlen = 0;
for (e = environ; *e; e++)
qhead->first_node = new_node(qhead->first_node, *e, strcspn(*e, "="));