diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2005-04-16 19:56:32 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2005-04-16 19:56:32 +0000 |
commit | 6ea60b1ca8bf98a22c223f177182274b0a6eb78a (patch) | |
tree | 2a24598314413ea9957d777a997db732db4b7285 /usr.sbin/bgpd/rde_attr.c | |
parent | cdf50ab163aa51be784346e28815b85963d0f89f (diff) |
Simplify return codes of aspath_asprint().
Return -1 on error 0 on success and make sure that in case of an error
*ret is set to NULL.
Diffstat (limited to 'usr.sbin/bgpd/rde_attr.c')
-rw-r--r-- | usr.sbin/bgpd/rde_attr.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/bgpd/rde_attr.c b/usr.sbin/bgpd/rde_attr.c index 9352e748da4..7a1495bd896 100644 --- a/usr.sbin/bgpd/rde_attr.c +++ b/usr.sbin/bgpd/rde_attr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_attr.c,v 1.45 2005/04/15 16:19:34 claudio Exp $ */ +/* $OpenBSD: rde_attr.c,v 1.46 2005/04/16 19:56:31 claudio Exp $ */ /* * Copyright (c) 2004 Claudio Jeker <claudio@openbsd.org> @@ -554,10 +554,13 @@ aspath_asprint(char **ret, void *data, u_int16_t len) return (-1); plen = aspath_snprint(*ret, slen, data, len); - if (plen == -1) + if (plen == -1) { free(*ret); + *ret = NULL; + return (-1); + } - return (plen); + return (0); } size_t |