Skip to content

Commit

Permalink
Issue3382 malloc jsonWriterInit.c (#3399)
Browse files Browse the repository at this point in the history
* Corrected pointer

See #3382 (comment)
  • Loading branch information
mwetter authored May 15, 2023
1 parent 13ed223 commit 60727ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Buildings/Resources/C-Sources/jsonWriterInit.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void* jsonWriterInit(

for (i = 0; i < numKeys; ++i)
{
ID-> varKeys[i] = (char **)malloc((strlen(varKeys[i])+1) * sizeof(char*));
ID-> varKeys[i] = (char *)malloc((strlen(varKeys[i])+1) * sizeof(char));
if ( ID->varKeys[i] == NULL )
ModelicaError("Not enough memory in jsonWriterInit.c for allocating varKeys.");
strcpy(ID->varKeys[i], varKeys[i]);
Expand Down

0 comments on commit 60727ae

Please sign in to comment.