Make CopyGraph safe against NULL argument.

Otherwise memcpy will fail.
This commit is contained in:
Holger Vogt 2019-09-08 09:35:55 +02:00
parent aa726c9864
commit ec6d676920
1 changed files with 3 additions and 0 deletions

View File

@ -109,6 +109,9 @@ CopyGraph(GRAPH *graph)
struct _keyed *k;
struct dveclist *link, *newlink;
if (!graph)
return NULL;
ret = NewGraph();
memcpy(ret, graph, sizeof(GRAPH)); /* va: compatible pointer types */