diff options
Diffstat (limited to 'src/lib/gnsrecord/test_gnsrecord_block_expiration.c')
-rw-r--r-- | src/lib/gnsrecord/test_gnsrecord_block_expiration.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/lib/gnsrecord/test_gnsrecord_block_expiration.c b/src/lib/gnsrecord/test_gnsrecord_block_expiration.c index 3ef02e631..bc580954e 100644 --- a/src/lib/gnsrecord/test_gnsrecord_block_expiration.c +++ b/src/lib/gnsrecord/test_gnsrecord_block_expiration.c | |||
@@ -49,6 +49,8 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
49 | struct GNUNET_GNSRECORD_Data rd[2]; | 49 | struct GNUNET_GNSRECORD_Data rd[2]; |
50 | struct GNUNET_TIME_Absolute expiration_abs; | 50 | struct GNUNET_TIME_Absolute expiration_abs; |
51 | struct GNUNET_TIME_Absolute expiration_abs_shadow; | 51 | struct GNUNET_TIME_Absolute expiration_abs_shadow; |
52 | char *tmp_data0; | ||
53 | char *tmp_data1; | ||
52 | 54 | ||
53 | expiration_abs.abs_value_us = GNUNET_TIME_absolute_get ().abs_value_us | 55 | expiration_abs.abs_value_us = GNUNET_TIME_absolute_get ().abs_value_us |
54 | + GNUNET_TIME_UNIT_SECONDS.rel_value_us; | 56 | + GNUNET_TIME_UNIT_SECONDS.rel_value_us; |
@@ -59,14 +61,16 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
59 | rd[0].expiration_time = expiration_abs.abs_value_us; | 61 | rd[0].expiration_time = expiration_abs.abs_value_us; |
60 | rd[0].record_type = TEST_RECORD_TYPE; | 62 | rd[0].record_type = TEST_RECORD_TYPE; |
61 | rd[0].data_size = TEST_RECORD_DATALEN; | 63 | rd[0].data_size = TEST_RECORD_DATALEN; |
62 | rd[0].data = GNUNET_malloc (TEST_RECORD_DATALEN); | 64 | tmp_data0 = GNUNET_malloc (TEST_RECORD_DATALEN); |
65 | rd[0].data = tmp_data0; | ||
63 | rd[0].flags = GNUNET_GNSRECORD_RF_NONE; | 66 | rd[0].flags = GNUNET_GNSRECORD_RF_NONE; |
64 | memset ((char *) rd[0].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); | 67 | memset ((char *) rd[0].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); |
65 | 68 | ||
66 | rd[1].expiration_time = expiration_abs.abs_value_us; | 69 | rd[1].expiration_time = expiration_abs.abs_value_us; |
67 | rd[1].record_type = TEST_RECORD_TYPE; | 70 | rd[1].record_type = TEST_RECORD_TYPE; |
68 | rd[1].data_size = TEST_RECORD_DATALEN; | 71 | rd[1].data_size = TEST_RECORD_DATALEN; |
69 | rd[1].data = GNUNET_malloc (TEST_RECORD_DATALEN); | 72 | tmp_data1 = GNUNET_malloc (TEST_RECORD_DATALEN); |
73 | rd[1].data = tmp_data1; | ||
70 | rd[1].flags = GNUNET_GNSRECORD_RF_NONE; | 74 | rd[1].flags = GNUNET_GNSRECORD_RF_NONE; |
71 | memset ((char *) rd[1].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); | 75 | memset ((char *) rd[1].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); |
72 | 76 | ||
@@ -78,7 +82,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
78 | rd[1].expiration_time = expiration_abs_shadow.abs_value_us; | 82 | rd[1].expiration_time = expiration_abs_shadow.abs_value_us; |
79 | rd[1].record_type = TEST_RECORD_TYPE; | 83 | rd[1].record_type = TEST_RECORD_TYPE; |
80 | rd[1].data_size = TEST_RECORD_DATALEN; | 84 | rd[1].data_size = TEST_RECORD_DATALEN; |
81 | GNUNET_free (rd[1].data); | 85 | GNUNET_free (tmp_data1); |
82 | rd[1].data = GNUNET_malloc (TEST_RECORD_DATALEN); | 86 | rd[1].data = GNUNET_malloc (TEST_RECORD_DATALEN); |
83 | rd[1].flags = GNUNET_GNSRECORD_RF_SHADOW; | 87 | rd[1].flags = GNUNET_GNSRECORD_RF_SHADOW; |
84 | memset ((char *) rd[1].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); | 88 | memset ((char *) rd[1].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); |
@@ -87,8 +91,8 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
87 | GNUNET_GNSRECORD_record_get_expiration_time (2, | 91 | GNUNET_GNSRECORD_record_get_expiration_time (2, |
88 | rd, | 92 | rd, |
89 | GNUNET_TIME_UNIT_ZERO_ABS).abs_value_us); | 93 | GNUNET_TIME_UNIT_ZERO_ABS).abs_value_us); |
90 | GNUNET_free (rd[0].data); | 94 | GNUNET_free (tmp_data0); |
91 | GNUNET_free (rd[1].data); | 95 | GNUNET_free (tmp_data1); |
92 | res = 0; | 96 | res = 0; |
93 | } | 97 | } |
94 | 98 | ||