# xmalloc

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/xmalloc.c#L27
- **Page:** https://libtmux.org/en/tmux/3.2a/reference/c-function-xmalloc/

```c
void * xmalloc(size_t size)
```

## Parameters

- `size` (`size_t`)

## Called by

- [`client_dispatch_exit_message`](/en/tmux/3.2a/reference/c-function-client-c-client_dispatch_exit_message/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/client.c#L609)
- [`client_main`](/en/tmux/3.2a/reference/c-function-client_main/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/client.c#L371)
- [`cmd_confirm_before_exec`](/en/tmux/3.2a/reference/c-function-cmd-confirm-before-c-cmd_confirm_before_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-confirm-before.c#L72)
- [`cmd_display_panes_exec`](/en/tmux/3.2a/reference/c-function-cmd-display-panes-c-cmd_display_panes_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-display-panes.c#L277)
- [`cmd_list_keys_exec`](/en/tmux/3.2a/reference/c-function-cmd-list-keys-c-cmd_list_keys_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-list-keys.c#L245)
- [`cmd_load_buffer_done`](/en/tmux/3.2a/reference/c-function-cmd-load-buffer-c-cmd_load_buffer_done/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-load-buffer.c#L71)
- [`cmd_run_shell_callback`](/en/tmux/3.2a/reference/c-function-cmd-run-shell-c-cmd_run_shell_callback/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-run-shell.c#L227)
- [`cmd_set_buffer_exec`](/en/tmux/3.2a/reference/c-function-cmd-set-buffer-c-cmd_set_buffer_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-set-buffer.c#L109)
- [`cmd_show_environment_escape`](/en/tmux/3.2a/reference/c-function-cmd-show-environment-c-cmd_show_environment_escape/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-show-environment.c#L56)
- [`cmd_template_replace`](/en/tmux/3.2a/reference/c-function-cmd_template_replace/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd.c#L788)
- [`cmd_wait_for_add`](/en/tmux/3.2a/reference/c-function-cmd-wait-for-c-cmd_wait_for_add/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-wait-for.c#L88)
- [`environ_clear`](/en/tmux/3.2a/reference/c-function-environ_clear/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/environ.c#L140)
- [`environ_set`](/en/tmux/3.2a/reference/c-function-environ_set/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/environ.c#L121)
- [`file_push`](/en/tmux/3.2a/reference/c-function-file_push/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/file.c#L448)
- [`file_read`](/en/tmux/3.2a/reference/c-function-file_read/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/file.c#L413)
- [`file_read_callback`](/en/tmux/3.2a/reference/c-function-file-c-file_read_callback/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/file.c#L672)
- [`file_write`](/en/tmux/3.2a/reference/c-function-file_write/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/file.c#L337)
- [`format_add`](/en/tmux/3.2a/reference/c-function-format_add/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/format.c#L3132)
- [`format_add_cb`](/en/tmux/3.2a/reference/c-function-format_add_cb/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/format.c#L3181)
- [`format_add_tv`](/en/tmux/3.2a/reference/c-function-format_add_tv/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/format.c#L3157)
- [`format_expand1`](/en/tmux/3.2a/reference/c-function-format-c-format_expand1/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/format.c#L4467)
- [`format_job_complete`](/en/tmux/3.2a/reference/c-function-format-c-format_job_complete/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/format.c#L324)
- [`format_job_get`](/en/tmux/3.2a/reference/c-function-format-c-format_job_get/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/format.c#L363)
- [`format_quote_shell`](/en/tmux/3.2a/reference/c-function-format-c-format_quote_shell/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/format.c#L3205)
- [`format_quote_style`](/en/tmux/3.2a/reference/c-function-format-c-format_quote_style/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/format.c#L3222)
- [`format_strip`](/en/tmux/3.2a/reference/c-function-format-c-format_strip/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/format.c#L3403)
- [`grid_create`](/en/tmux/3.2a/reference/c-function-grid_create/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/grid.c#L276)
- [`grid_string_cells`](/en/tmux/3.2a/reference/c-function-grid_string_cells/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/grid.c#L971)
- [`input_osc_52`](/en/tmux/3.2a/reference/c-function-input-c-input_osc_52/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/input.c#L2653)
- [`job_run`](/en/tmux/3.2a/reference/c-function-job_run/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/job.c#L162)
- [`key_bindings_get_table`](/en/tmux/3.2a/reference/c-function-key_bindings_get_table/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/key-bindings.c#L109)
- [`layout_create_cell`](/en/tmux/3.2a/reference/c-function-layout_create_cell/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/layout.c#L55)
- [`mode_tree_display_menu`](/en/tmux/3.2a/reference/c-function-mode-tree-c-mode_tree_display_menu/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/mode-tree.c#L960)
- [`paste_add`](/en/tmux/3.2a/reference/c-function-paste_add/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/paste.c#L181)
- [`paste_set`](/en/tmux/3.2a/reference/c-function-paste_set/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/paste.c#L278)
- [`screen_push_title`](/en/tmux/3.2a/reference/c-function-screen_push_title/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/screen.c#L198)
- [`server_client_check_exit`](/en/tmux/3.2a/reference/c-function-server-client-c-server_client_check_exit/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/server-client.c#L1817)
- [`server_client_click_timer`](/en/tmux/3.2a/reference/c-function-server-client-c-server_client_click_timer/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/server-client.c#L1776)
- [`server_client_exec`](/en/tmux/3.2a/reference/c-function-server_client_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/server-client.c#L466)
- [`session_create`](/en/tmux/3.2a/reference/c-function-session_create/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/session.c#L135)
- [`status_prompt_complete_list_menu`](/en/tmux/3.2a/reference/c-function-status-c-status_prompt_complete_list_menu/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/status.c#L1535)
- [`status_prompt_complete_window_menu`](/en/tmux/3.2a/reference/c-function-status-c-status_prompt_complete_window_menu/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/status.c#L1591)
- [`status_prompt_load_history`](/en/tmux/3.2a/reference/c-function-status_prompt_load_history/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/status.c#L107)
- [`status_push_screen`](/en/tmux/3.2a/reference/c-function-status-c-status_push_screen/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/status.c#L269)
- [`tty_keys_clipboard`](/en/tmux/3.2a/reference/c-function-tty-keys-c-tty_keys_clipboard/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/tty-keys.c#L1202)
- [`tty_keys_next`](/en/tmux/3.2a/reference/c-function-tty_keys_next/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/tty-keys.c#L830)
- [`tty_set_selection`](/en/tmux/3.2a/reference/c-function-tty_set_selection/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/tty.c#L1908)
- [`utf8_padcstr`](/en/tmux/3.2a/reference/c-function-utf8_padcstr/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/utf8.c#L554)
- [`utf8_rpadcstr`](/en/tmux/3.2a/reference/c-function-utf8_rpadcstr/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/utf8.c#L575)
- [`window_clock_init`](/en/tmux/3.2a/reference/c-function-window-clock-c-window_clock_init/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-clock.c#L162)
- [`window_copy_cellstring`](/en/tmux/3.2a/reference/c-function-window-copy-c-window_copy_cellstring/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-copy.c#L2724)
- [`window_copy_get_selection`](/en/tmux/3.2a/reference/c-function-window-copy-c-window_copy_get_selection/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-copy.c#L3974)
- [`window_copy_search_jump`](/en/tmux/3.2a/reference/c-function-window-copy-c-window_copy_search_jump/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-copy.c#L3012)
- [`window_copy_search_lr_regex`](/en/tmux/3.2a/reference/c-function-window-copy-c-window_copy_search_lr_regex/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-copy.c#L2609)
- [`window_copy_search_marks`](/en/tmux/3.2a/reference/c-function-window-copy-c-window_copy_search_marks/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-copy.c#L3298)
- [`window_copy_search_rl_regex`](/en/tmux/3.2a/reference/c-function-window-copy-c-window_copy_search_rl_regex/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-copy.c#L2666)
- [`window_copy_view_init`](/en/tmux/3.2a/reference/c-function-window-copy-c-window_copy_view_init/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window-copy.c#L475)
- [`window_pane_resize`](/en/tmux/3.2a/reference/c-function-window_pane_resize/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window.c#L995)
- [`window_pane_start_input`](/en/tmux/3.2a/reference/c-function-window_pane_start_input/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/window.c#L1560)

## Calls

- [`fatalx`](/en/tmux/3.2a/reference/c-function-fatalx/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/xmalloc.c#L32)

## Referenced by

- [`input_init`](/en/tmux/3.2a/reference/c-function-input_init/) (function)
- [`screen_write_collect_add`](/en/tmux/3.2a/reference/c-function-screen_write_collect_add/) (function)
