author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Tue, 24 Feb 2009 09:08:29 +0000 (10:08 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Tue, 24 Feb 2009 09:15:36 +0000 (10:15 +0100) | ||
commit | 7ef8f8ed456a9a1a6cfd5b9da04836bf867d6842 | |
tree | bf72090b4bd277a61bf2b7499f908a1897b7320a | tree | snapshot |
parent | 3b8268a9fd1adc3f89f8c99c086b54f172550556 | commit | diff |
src/plugin.c: Assure that targets get dynamically allocated memory.
If targets want to replace the values, they will have to use dynamically
allocated memory. If they can't free the values, because the pointer
might point to statically allocated memory, memory will be lost.
Unfortunately stack allocation will not do, since we will then not be able
to detect multiple replacements.
To impose as little a performance issue as possible, the dynamic allo-
cation is only done when either chain is present. If the filter mecha-
nism is not used, the values will not be copied.
If targets want to replace the values, they will have to use dynamically
allocated memory. If they can't free the values, because the pointer
might point to statically allocated memory, memory will be lost.
Unfortunately stack allocation will not do, since we will then not be able
to detect multiple replacements.
To impose as little a performance issue as possible, the dynamic allo-
cation is only done when either chain is present. If the filter mecha-
nism is not used, the values will not be copied.
src/plugin.c | diff | blob | history |