X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Frunas.c;h=0a588482644f5138b138edfc39ab3002ebb48aeb;hp=f3adf7355444fe8a8961f1132151110b891fc4ba;hb=3c5427016ecdb32b5d75af2112371dd22c6889d3;hpb=51c2fb6c453e66de5f2552569daa490a4f02a4fd diff --git a/src/common/runas.c b/src/common/runas.c index f3adf7355..0a5884826 100644 --- a/src/common/runas.c +++ b/src/common/runas.c @@ -402,11 +402,14 @@ int send_fd_to_master(struct run_as_worker *worker, enum run_as_cmd cmd, int fd) ret = -1; } + if (fd < 0) { + goto end; + } ret_close = close(fd); if (ret_close < 0) { PERROR("close"); } - +end: return ret; }