Re: freeing a static after one use only?

From: Mike Galbraith (mikeg@weiden.de)
Date: Sun Feb 20 2000 - 00:07:50 EST


On Sat, 19 Feb 2000, Peter T. Breuer wrote:

> "A month of sundays ago Mike Galbraith wrote:"
> > On Fri, 18 Feb 2000, Peter T. Breuer wrote:
> >
> > A module containing only data is remarkably similar to a file.. and
> > load/use/eject is DAMNED similar to open/read/close. I suppose cool
> > ideas deserve to be reinvented once in a while :)

> Maybe I commented on this to you already. It'll work. The sound drivers
> do it. But it's "inconvenient". That's why I'm trying to avoid it.

> ucName[count] = ucIndexName[i]; // write to first from second
> } else {
> printk (KERN_INFO "lost key %d: %u\n", count, key);
> ucName[count] = "????";
                             ^^^^
I've no idea what the rest of your code is doing, but if ucName[] is
being filled with pointers like this one.. across modules, it doesn't
matter much if you overran your array or not. (&"whatever" points to
Nirvana after module is unloaded)

        -Mike

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Feb 23 2000 - 21:00:24 EST