Browse Source

intensity: prevent double free on change from (t)ui

tweaked
Tanguy Pruvot 9 years ago committed by elbandi
parent
commit
d6e6f10881
  1. 5
      config_parser.c

5
config_parser.c

@ -2193,9 +2193,8 @@ void api_pool_profile(struct io_data *io_data, __maybe_unused SOCKETTYPE c, char
void update_config_intensity(struct profile *profile) void update_config_intensity(struct profile *profile)
{ {
char buf[256] = { 0 };
int i; int i;
char buf[255];
memset(buf, 0, 255);
for (i = 0; i<nDevs; ++i) { for (i = 0; i<nDevs; ++i) {
if (gpus[i].dynamic) { if (gpus[i].dynamic) {
@ -2206,7 +2205,7 @@ void update_config_intensity(struct profile *profile)
} }
} }
if (profile->intensity) { if (profile->intensity && profile->intensity != default_profile.intensity) {
free(profile->intensity); free(profile->intensity);
} }

Loading…
Cancel
Save