Skip to content

Commit

Permalink
Fix valgrind warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Benau committed Aug 23, 2020
1 parent dc0a5a9 commit 7b4d1dc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/sheenbidi/Source/SBParagraph.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <SBConfig.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>

#include "BidiChain.h"
#include "BidiTypeLookup.h"
Expand Down Expand Up @@ -54,6 +55,7 @@ static ParagraphContextRef CreateParagraphContext(const SBBidiType *types, SBLev
const SBUInteger offsetTypes = offsetLinks + sizeLinks;

SBUInt8 *memory = (SBUInt8 *)malloc(sizeMemory);
memset(memory, 0, sizeMemory);
ParagraphContextRef context = (ParagraphContextRef)(memory + offsetContext);
BidiLink *fixedLinks = (BidiLink *)(memory + offsetLinks);
SBBidiType *fixedTypes = (SBBidiType *)(memory + offsetTypes);
Expand Down

0 comments on commit 7b4d1dc

Please sign in to comment.