diff options
author | Jeroen <jeroen@nijhofnet.nl> | 2011-08-19 23:00:05 +0200 |
---|---|---|
committer | Jeroen <jeroen@nijhofnet.nl> | 2011-08-19 23:00:05 +0200 |
commit | 638486dec6577299c7d8282da4b2f02fc9871bbd (patch) | |
tree | 763974070ab0675740ec2966b9f64e123d2a7e33 /libtac/lib/cont_s.c | |
parent | d1134977b9317c6161ae12608684ea857915a63c (diff) | |
download | pam_tacplus-638486dec6577299c7d8282da4b2f02fc9871bbd.tar.gz pam_tacplus-638486dec6577299c7d8282da4b2f02fc9871bbd.zip |
Finally got rid of all goto illness!
Diffstat (limited to 'libtac/lib/cont_s.c')
-rw-r--r-- | libtac/lib/cont_s.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/libtac/lib/cont_s.c b/libtac/lib/cont_s.c index a438a63..8382bc5 100644 --- a/libtac/lib/cont_s.c +++ b/libtac/lib/cont_s.c @@ -64,8 +64,9 @@ int tac_cont_send(int fd, char *pass) { if (w < 0 || w < TAC_PLUS_HDR_SIZE) { TACSYSLOG((LOG_ERR, "%s: short write on header, wrote %d of %d: %m",\ __FUNCTION__, w, TAC_PLUS_HDR_SIZE)) - ret=LIBTAC_STATUS_WRITE_ERR; - goto ContExit; + free(pkt); + free(th); + return LIBTAC_STATUS_WRITE_ERR; } /* build the packet */ @@ -81,8 +82,9 @@ int tac_cont_send(int fd, char *pass) { TACSYSLOG((LOG_ERR,\ "%s: bodylength %d != pkt_len %d",\ __FUNCTION__, bodylength, pkt_len)) - ret=LIBTAC_STATUS_ASSEMBLY_ERR; - goto ContExit; + free(pkt); + free(th); + return LIBTAC_STATUS_ASSEMBLY_ERR; } /* encrypt the body */ @@ -96,11 +98,8 @@ int tac_cont_send(int fd, char *pass) { ret=LIBTAC_STATUS_WRITE_ERR; } -ContExit: - free(pkt); free(th); - TACDEBUG((LOG_DEBUG, "%s: exit status=%d", __FUNCTION__, ret)) - return(ret); + return ret; } /* tac_cont_send */ |