]> git.pld-linux.org Git - projects/setup.git/commitdiff
- check for malloc failure
authorElan Ruusamäe <glen@pld-linux.org>
Sat, 17 Sep 2005 13:10:26 +0000 (13:10 +0000)
committerElan Ruusamäe <glen@pld-linux.org>
Sat, 17 Sep 2005 13:10:26 +0000 (13:10 +0000)
Changed files:
    update-fstab.c -> 1.2

update-fstab.c

index 34fb649090d467a1237370a72c47784d3aedf05b..9a85d2f3d5b57070cebaccf6a368225d268d8239 100644 (file)
@@ -36,6 +36,10 @@ int main()
        }
        fstat(fd, &st);
        old = (char *) malloc(st.st_size);
+       if (old == NULL) {
+               eputs("\nError: malloc failure\n");
+               return 1;
+       }
        read(fd, old, st.st_size);
        close(fd);
        old_sz = st.st_size;
This page took 0.090712 seconds and 4 git commands to generate.