Fix wrong malloc()

Error reported by cppcheck

    Size of pointer 'cell_var' used instead of size of its data. [pointerSize]
      console_var_t * cell_var =
                  ^
This commit is contained in:
Glenn Y. Rolland 2020-02-14 08:16:48 +01:00
parent 152dd5670e
commit af7b7d4291

View file

@ -28,7 +28,7 @@ void console_register_variable(Console_t * console,
if (!console_is_registered_variable(console, varname)){
// on crée la structure;
console_var_t * cell_var =
(console_var_t *) malloc (sizeof(console_var_t *));
(console_var_t *) malloc (sizeof(console_var_t));
// remplir les champs de cell_var;
//cell_var->name = strndup(varname, varnamelen);