diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2021-01-05 14:47:49 +0100 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2021-01-11 20:12:34 +0100 |
commit | 70f48f1f44bf419aac77de8664816a17122c8b29 (patch) | |
tree | 1959d394f65bf68a942e9ef4018f22a534eecfc3 /Meter.c | |
parent | 958112c5a396815da7a731f406dbfd27bf713572 (diff) |
Add wrapper function for free and strdup
Reduces code in callers and helps avoiding memory leaks.
Diffstat (limited to 'Meter.c')
-rw-r--r-- | Meter.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -93,8 +93,7 @@ void Meter_delete(Object* cast) { } void Meter_setCaption(Meter* this, const char* caption) { - free(this->caption); - this->caption = xStrdup(caption); + free_and_xStrdup(&this->caption, caption); } static inline void Meter_displayBuffer(const Meter* this, const char* buffer, RichString* out) { |