aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ws.c
diff options
context:
space:
mode:
authorOmar Rizwan <omar.rizwan@gmail.com>2019-02-25 19:57:07 -0800
committerOmar Rizwan <omar.rizwan@gmail.com>2019-02-25 19:57:07 -0800
commitcca53bc19952feb02fb01207f636bd66d5f2c8d2 (patch)
tree6f7301cba993d8332be9930dab1cc2df2ce61b12 /fs/ws.c
parenta8ce61d9a1b987d18f5deabba0565465be8d4a3a (diff)
fs: Some comments.
Diffstat (limited to 'fs/ws.c')
-rw-r--r--fs/ws.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/ws.c b/fs/ws.c
index 6798b3f..a397eab 100644
--- a/fs/ws.c
+++ b/fs/ws.c
@@ -37,20 +37,22 @@ static int fill_fd_set_with_ws_sockets(fd_set *read_fds, fd_set *write_fds, fd_s
static void receive_tabfs_request_then_send_to_browser() {
char *request_data = common_receive_tabfs_to_ws(fill_fd_set_with_ws_sockets);
if (request_data == NULL) {
- return;
+ goto done;
}
if (con == NULL) {
common_send_ws_to_tabfs(NULL);
- return;
+ goto done;
}
wby_frame_begin(con, WBY_WSOP_TEXT_FRAME);
wby_write(con, request_data, strlen(request_data));
wby_frame_end(con);
+ done:
// Was allocated by sender (tabfs.c, send_request_then_await_response).
- free(request_data);
+ if (request_data != NULL) { free(request_data); }
+ return;
}
static int