]> arthur.barton.de Git - netatalk.git/commitdiff
fix a small leak.
authordidg <didg>
Tue, 11 May 2004 08:30:07 +0000 (08:30 +0000)
committerdidg <didg>
Tue, 11 May 2004 08:30:07 +0000 (08:30 +0000)
etc/afpd/volume.c

index 185e72266e28463f7206407d3d913f41a6af661f..069e0c540d4514ba90bf7d9537493c9ef3f00ee8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: volume.c,v 1.51.2.7.2.29 2004-05-04 15:38:25 didg Exp $
+ * $Id: volume.c,v 1.51.2.7.2.30 2004-05-11 08:30:07 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -2084,6 +2084,7 @@ static int create_special_folder (const struct vol *vol, const struct _special_f
                    if (ad_mkdir(p, folder->mode)) {
                        LOG(log_debug, logtype_afpd,"Creating '%s' failed in %s: %s", p, vol->v_path, strerror(errno));
                        free(p);
+                       free(q);
                        return -1;
                     }
                    ret = 0;
@@ -2096,6 +2097,7 @@ static int create_special_folder (const struct vol *vol, const struct _special_f
                if (ad_open( p, vol_noadouble(vol) | ADFLAGS_HF|ADFLAGS_DIR,
                        O_RDWR|O_CREAT, 0666, &ad) < 0) {
                        free (p);
+                       free(q);
                        return (-1);
                }
                if ((ad_get_HF_flags( &ad ) & O_CREAT) ) {
@@ -2109,7 +2111,14 @@ static int create_special_folder (const struct vol *vol, const struct _special_f
                ad_getattr(&ad, &attr);
                attr |= htons( ntohs( attr ) | ATTRBIT_INVISIBLE );
                ad_setattr(&ad, attr);
-    
+#if 0          
+               /* do the same with the finder info */
+               if (ad_entry(&ad, ADEID_FINDERI)) {
+                       memcpy(&attr, ad_entry(&ad, ADEID_FINDERI) + FINDERINFO_FRFLAGOFF, sizeof(attr));
+                       attr   |= htons(FINDERINFO_INVISIBLE);
+                       memcpy(ad_entry(&ad, ADEID_FINDERI) + FINDERINFO_FRFLAGOFF,&attr, sizeof(attr));
+               }
+#endif    
                ad_flush( &ad, ADFLAGS_HF );
                ad_close( &ad, ADFLAGS_HF );
        }