]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: stream_dup memory alloc cannot fail
authorDonald Sharp <sharpd@nvidia.com>
Wed, 15 Jun 2022 14:23:28 +0000 (10:23 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Wed, 15 Jun 2022 14:24:01 +0000 (10:24 -0400)
If stream_dup calls stream_new, stream_new can never
return a NULL pointer so the check is unneeded.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
lib/stream.c

index c15baa0a2ccf1b098640d089b4ce77d752860e17..011e921c0d87cfd06bc7599bcd6444f8e9225229 100644 (file)
@@ -145,8 +145,7 @@ struct stream *stream_dup(const struct stream *s)
 
        STREAM_VERIFY_SANE(s);
 
-       if ((snew = stream_new(s->endp)) == NULL)
-               return NULL;
+       snew = stream_new(s->endp);
 
        return (stream_copy(snew, s));
 }