Skip to content

Commit

Permalink
don't leak client states hash
Browse files Browse the repository at this point in the history
Summary:
```
Direct leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x4bc6e0 in calloc ??:?
    #1 0x7f3b47ba69e7 in w_hash_bytes ./watchman/hash.cpp:247
    #2 0x7f3b47b969da in cmd_state_enter(watchman_client*, json_t*) ./watchman/cmds/state.cpp:126
    #3 0x7f3b47b952d1 in dispatch_command ./watchman/cmds/reg.cpp:180
    #4 0x7f3b47bb480c in client_thread(void*) ./watchman/listener.cpp:194
    #5 0x7f3b473a37f0 in start_thread /home/engshare/third-party2/glibc/2.20/src/glibc-2.20/nptl/pthread_create.c:310 (discriminator 6)
```

Reviewed By: sid0

fbshipit-source-id: 7d89e233485fc1ede7bcc0c8511fe710d2062ab4
  • Loading branch information
wez authored and Facebook Github Bot 3 committed Sep 18, 2016
1 parent b8b71ae commit eba7f3b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmds/state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@ void w_client_vacate_states(struct watchman_user_client *client) {
// the iterator.
leave_state(client, assertion, true, NULL, NULL);
}

w_ht_free(client->states);
}

static void cmd_state_leave(struct watchman_client *clientbase, json_t *args) {
Expand Down

0 comments on commit eba7f3b

Please sign in to comment.