Download for MacApple silicon, macOS 14+
Skill

memory-api-misuse

@thejefflarson Updated 2026-07-31

Detects function-local misuse of memory and resource APIs in C, C++, and Rust unsafe — allocations whose return value is not checked, frees on error paths that race the success path, locks initialized incorrectly, file descriptors leaked across exec. Use when writing or modifying C or C++ code that calls malloc/calloc/realloc/free, mmap/munmap, pthread_mutex_*, fopen/open, or any kernel/library memory or resource primitive. Use when writing Rust code inside an unsafe block that calls a raw allocation or pointer API.

llmssecurityskills

Install

With your agent

Install OMGSkills skill "thejefflarson/soundcheck:.claude/skills/memory-api-misuse" into this agent's normal skills directory: call the OMGSkills MCP get_install_plan tool for your agent and run the script it returns (it installs only the pinned commit and verifies SKILL.md), and stop if MCP or the pin is unavailable. Do not overwrite or change existing skills without asking me.

Manual command

git clone https://github.com/thejefflarson/soundcheck /tmp/soundcheck && ln -s /tmp/soundcheck/.claude/skills/memory-api-misuse ~/.claude/skills/memory-api-misuse

From README

Memory API Misuse (CWE-690, CWE-415, CWE-401) What this checks C, C++, and Rust unsafe memory and resource APIs called incorrectly at a single call site — a NULL return dereferenced, a double-free on an error path, a lock used before init, a file descriptor that survives exec(). Existing static analyzers catch the easy cases; this skill targets the ones that read clean on first pass but fail in error or cleanup paths. It does local pattern matching at the call site, not whole-program lifetime analysis (that's the job of TSAN, ASAN, Valgrind, and the Rust borrow checker).