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:
committed by
Andreas Schneider
parent
2eb2af4426
commit
7501ca1e08
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user