[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: replace alloca with strdup
From: |
Andreas Schwab |
Subject: |
Re: replace alloca with strdup |
Date: |
Sun, 22 May 2005 01:49:51 +0200 |
User-agent: |
Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (gnu/linux) |
Han Boetes <address@hidden> writes:
> Advantages are:
>
> - simpler code
Not really.
> - strdup is more portable
Not more than alloca.
> - error handling
Which error?
> - you don't have to worry about strdup concerning security
The code you changed is already obviously safe.
> I hope you like the idea.
No. Nobody is reclaiming the storage, so you introduced a memory leak.
Andreas.
--
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."