← スキル一覧に戻る

detecting-incorrect-free
by waiwai24
⭐ 1🍴 0📅 2026年1月4日
SKILL.md
name: detecting-incorrect-free description: Detects incorrect use of free() including freeing non-heap memory, invalid pointers, and mismatched allocators. Use when analyzing memory deallocation, heap management, or investigating free() usage errors.
Incorrect Use of Free Detection
Detection Workflow
- Identify free operations: Find all free() calls, locate delete/delete[] calls, map deallocation points, note pointers being freed
- Trace pointer origins: Find where pointers originate, identify allocation method, track pointer assignments, assess pointer validity
- Analyze memory type: Verify pointer points to heap memory, check for stack variables, identify static/global variables, assess pointer validity
- Assess impact: Can incorrect free cause crash? Can it cause heap corruption? What's the security impact? Is it exploitable?
Key Patterns
- Freeing non-heap memory: free() on stack variables, free() on static/global variables, free() on string literals, free() on automatic storage
- Freeing invalid pointers: free() on NULL pointer, free() on already-freed memory, free() on uninitialized pointers, free() on middle of allocations
- Mismatched allocators: free() on new-allocated memory, delete on malloc-allocated memory, cross-allocator deallocation, mixed C/C++ memory management
- Double free patterns: multiple free() on same pointer, free() in multiple code paths, free() in error handling, free() in cleanup functions
Output Format
Report with: id, type, subtype, severity, confidence, location, vulnerability, freed_pointer, pointer_type, allocation_type, free_operation, exploitable, attack_scenario, impact, mitigation.
Severity Guidelines
- HIGH: Incorrect free causing heap corruption
- MEDIUM: Incorrect free causing crashes
- LOW: Incorrect free with limited impact
See Also
patterns.md- Detailed detection patterns and exploitation scenariosexamples.md- Example analysis cases and code samplesreferences.md- CWE references and mitigation strategies
スコア
総合スコア
55/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
○言語
プログラミング言語が設定されている
0/5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です