1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-10-23 03:28:55 +03:00

examples: Fix possible pass of NULL into strchr()

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2025-04-25 10:28:28 +02:00
committed by Andreas Schneider
parent 2eb2af4426
commit 7501ca1e08

View File

@@ -119,6 +119,10 @@ static struct location *parse_location(char *loc)
struct location *location = NULL;
char *ptr = NULL;
if (loc == NULL) {
return NULL;
}
location = malloc(sizeof(struct location));
if (location == NULL) {
return NULL;