Skip to content

Commit c12127a

Browse files
authored
Merge pull request #1238 from shuxin/patch-1
fix a dead loop in hash_op.c
2 parents 6916937 + ade79e1 commit c12127a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/shared/hash_op.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,9 @@ void *OSHash_Get(const OSHash *self, const char *key)
243243
/* Get entry */
244244
curr_node = self->table[index];
245245
while (curr_node != NULL) {
246-
/* Skip null pointers */
247-
if ( curr_node->key == NULL ) {
248-
continue;
249-
}
250246

251247
/* We may have colisions, so double check with strcmp */
252-
if (strcmp(curr_node->key, key) == 0) {
248+
if (curr_node->key != NULL && strcmp(curr_node->key, key) == 0) {
253249
return (curr_node->data);
254250
}
255251

0 commit comments

Comments
 (0)