Make CopyGraph safe against NULL argument.
Otherwise memcpy will fail.
This commit is contained in:
parent
aa726c9864
commit
ec6d676920
|
|
@ -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 */
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue