]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/appl.c
Fix regression introduced by previous IPC fds fix
[netatalk.git] / etc / afpd / appl.c
index fe9ff250336214d410a32bee946578865d490fd2..78b7587d8b829c7c89b4fb6fd828b10aea07a323 100644 (file)
@@ -22,9 +22,9 @@
 #include <atalk/afp.h>
 #include <atalk/bstrlib.h>
 #include <atalk/bstradd.h>
+#include <atalk/globals.h>
 
 #include "volume.h"
-#include "globals.h"
 #include "directory.h"
 #include "file.h"
 #include "desktop.h"
@@ -250,6 +250,7 @@ int afp_addappl(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, siz
     mpath = obj->newtmp;
     mp = makemacpath( vol, mpath, AFPOBJ_TMPSIZ, curdir, path->m_name );
     if (!mp) {
+        close(tfd);
         return AFPERR_PARAM;
     }
     mplen =  mpath + AFPOBJ_TMPSIZ - mp;
@@ -263,6 +264,7 @@ int afp_addappl(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, siz
     memcpy(p, appltag, sizeof( appltag ));
     cc = mpath + AFPOBJ_TMPSIZ - p;
     if ( write( tfd, p, cc ) != cc ) {
+        close(tfd);
         unlink( tempfile );
         return( AFPERR_PARAM );
     }
@@ -333,6 +335,7 @@ int afp_rmvappl(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, siz
     mpath = obj->newtmp;
     mp = makemacpath( vol, mpath, AFPOBJ_TMPSIZ, curdir, path->m_name );
     if (!mp) {
+        close(tfd);
         return AFPERR_PARAM ;
     }