diff options
| author | Ondrej Čerman <ondrej.cerman@gmail.com> | 2019-11-01 09:39:13 +0100 | 
|---|---|---|
| committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2019-11-16 13:45:22 -0800 | 
| commit | 2b6483c3e9fd633c0b32364d1fdc111433c70198 (patch) | |
| tree | b18f3fa198507d50025560a2aedf0ceccf0915d8 /modules/devices/x86 | |
| parent | e4f7b65856c0a304b371e04b9c4d5f2d75b465e6 (diff) | |
x86/processor: malloc buffer
Diffstat (limited to 'modules/devices/x86')
| -rw-r--r-- | modules/devices/x86/processor.c | 4 | 
1 files changed, 3 insertions, 1 deletions
| diff --git a/modules/devices/x86/processor.c b/modules/devices/x86/processor.c index c6c77cd4..86a957bb 100644 --- a/modules/devices/x86/processor.c +++ b/modules/devices/x86/processor.c @@ -454,8 +454,9 @@ GSList *processor_scan(void)      GSList *procs = NULL, *l = NULL;      Processor *processor = NULL;      FILE *cpuinfo; -    gchar buffer[PROC_SCAN_READ_BUFFER_SIZE]; +    gchar *buffer; +    buffer = (gchar *) g_malloc(PROC_SCAN_READ_BUFFER_SIZE * sizeof(gchar));      cpuinfo = fopen(PROC_CPUINFO, "r");      if (!cpuinfo)          return NULL; @@ -513,6 +514,7 @@ GSList *processor_scan(void)      }      fclose(cpuinfo); +    g_free(buffer);      /* finish last */      if (processor) | 
