File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,15 +83,18 @@ TEST_CASE("MMH", "[libts][MMH]")
8383 printf (" ********** collision %d\n " , xy);
8484 }
8585
86- unsigned char *s = (unsigned char *)MMH_x;
87- int l = sizeof (MMH_x);
88- unsigned char *s1 = (unsigned char *)ats_malloc (l + 3 );
86+ unsigned char *s = (unsigned char *)MMH_x;
87+ int l = sizeof (MMH_x);
88+ unsigned char *s1 = (unsigned char *)ats_malloc (l + sizeof (uint32_t ));
89+ unsigned char *free_s1 = s1;
8990 s1 += 1 ;
9091 memcpy (s1, s, l);
91- unsigned char *s2 = (unsigned char *)ats_malloc (l + 3 );
92+ unsigned char *s2 = (unsigned char *)ats_malloc (l + sizeof (uint32_t ));
93+ unsigned char *free_s2 = s2;
9294 s2 += 2 ;
9395 memcpy (s2, s, l);
94- unsigned char *s3 = (unsigned char *)ats_malloc (l + 3 );
96+ unsigned char *s3 = (unsigned char *)ats_malloc (l + sizeof (uint32_t ));
97+ unsigned char *free_s3 = s3;
9598 s3 += 3 ;
9699 memcpy (s3, s, l);
97100
@@ -136,4 +139,9 @@ TEST_CASE("MMH", "[libts][MMH]")
136139 if (!(z % 7 ))
137140 printf (" \n " );
138141 }
142+ printf (" \n " );
143+
144+ ats_free (free_s1);
145+ ats_free (free_s2);
146+ ats_free (free_s3);
139147}
You can’t perform that action at this time.
0 commit comments