Whamcloud - gitweb
Free buf alloced when program exit normally.
authorfanyong <fanyong>
Tue, 8 Aug 2006 02:28:46 +0000 (02:28 +0000)
committerfanyong <fanyong>
Tue, 8 Aug 2006 02:28:46 +0000 (02:28 +0000)
lustre/utils/create_iam.c

index 8683d3b..5268802 100644 (file)
@@ -340,9 +340,9 @@ int main(int argc, char **argv)
                 lvar_leaf(buf, blocksize, keysize, ptrsize, recsize);
 
         rc = write(1, buf, blocksize);
+        free(buf);
         if (rc != blocksize) {
                 fprintf(stderr, "Unable to write leaf node: %m (%i)\n", rc);
-                free(buf);
                 return 1;
         }
         if (verbose > 0)