]> andersk Git - moira.git/commitdiff
check for running out of memory
authormar <mar>
Mon, 11 Sep 1989 11:46:39 +0000 (11:46 +0000)
committermar <mar>
Mon, 11 Sep 1989 11:46:39 +0000 (11:46 +0000)
dbck/phase4.qc

index 5c2727f830ba67802ab2b70f84f8978d5287d287..7ac4fc8a75aee17b067a39f4a41eb491180135c5 100644 (file)
@@ -122,6 +122,8 @@ count_only_setup()
 ##           id2 = u.pop_id, id3 = u.box_id) 
 ##    where u.potype = "POP" {
        u = (struct user *) malloc(sizeof(struct user));
+       if (u == NULL)
+         out_of_mem("storing users");
        strcpy(u->login, strtrim(name));
        u->potype = buf[0];
        sprintf(buf, "%s, %s", strtrim(last), strtrim(first));
@@ -146,6 +148,8 @@ count_only_setup()
 ##  range of m is machine
 ##  retrieve (id = m.mach_id, name = m.#name) {
        m = (struct machine *) malloc(sizeof(struct machine));
+       if (m == NULL)
+         out_of_mem("storing machines");
        strcpy(m->name, strtrim(name));
        m->mach_id = id;
        hash_store(machines, id, m);
@@ -156,6 +160,8 @@ count_only_setup()
 ##  retrieve (id = nfsphys.nfsphys_id, name = nfsphys.dir,
 ##           id2 = nfsphys.mach_id, id3 = nfsphys.allocated) {
        n = (struct nfsphys *) malloc(sizeof(struct nfsphys));
+       if (n == NULL)
+         out_of_mem("storing nfsphys");
        strcpy(n->dir, strtrim(name));
        n->mach_id = id2;
        n->nfsphys_id = id;
This page took 0.319436 seconds and 5 git commands to generate.