mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-13 12:44:34 +03:00
Add wrapper function for free and strdup
Reduces code in callers and helps avoiding memory leaks.
This commit is contained in:

committed by
BenBE

parent
958112c5a3
commit
70f48f1f44
3
Meter.c
3
Meter.c
@ -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) {
|
||||
|
Reference in New Issue
Block a user