]> Cypherpunks repositories - gostls13.git/commitdiff
dangling pointer bug (thanks valgrind)
authorRuss Cox <rsc@golang.org>
Thu, 4 Jun 2009 20:33:29 +0000 (13:33 -0700)
committerRuss Cox <rsc@golang.org>
Thu, 4 Jun 2009 20:33:29 +0000 (13:33 -0700)
R=r
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=29881
CL=29885

src/cmd/ld/go.c

index 8ba7d12ce34f9578d1aba4d12f4c66d7f4d7c32f..e20f10a1476d85a8cb52ba834db919259898103c 100644 (file)
@@ -59,7 +59,7 @@ ilookup(char *name)
                if(x->name[0] == name[0] && strcmp(x->name, name) == 0)
                        return x;
        x = mal(sizeof *x);
-       x->name = name;
+       x->name = strdup(name);
        x->hash = ihash[h];
        ihash[h] = x;
        nimport++;