Repository navigation
Commit 83a4c9c
committed
fix: address PR #19 review findings on argument ownership and UI errors
source_search.c: when a literal pattern containing whitespace is rewritten
into a word-order regex ("foo bar" -> "foo.*bar"), the replacement buffer
was allocated with raw malloc() but later released with
cbm_operation_arg_free() on every cleanup path, which charges the
operation-argument class for memory it never accounted and trips the
ownership check when memory phases are enabled. Allocate it with
cbm_alloc(CBM_MEM_CLASS_OPERATION_ARG, ...) so the pattern keeps one
allocation class whichever branch produced it. The raw site count for
source_search.c drops from 64 to 63 in scripts/memory-core-baseline.txt.
project_arg.c: the sanitized-name, normalized-path and cache-tail branches
freed the caller's project string before checking whether the replacement
copy was allocated. On allocation failure they returned NULL, and callers
then reported "project is required" for a request that did supply one.
Each branch now keeps the original project when its copy fails and frees
it only after the replacement exists.
graph-ui native.ts: fetchRead parsed the body as JSON before checking the
status, so a non-JSON error body (the server's plain-text 404, a proxy
error page) surfaced as a JSON SyntaxError instead of "HTTP <status>".
Check res.ok first and parse the error body defensively.1 parent 39cf455 commit 83a4c9c
4 files changed
Lines changed: 16 additions & 7 deletions
File tree
- graph-ui/src/api
- scripts
- src/operations
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
12 | 13 | | |
13 | | - | |
| 14 | + | |
14 | 15 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| |||
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
| 59 | + | |
| 60 | + | |
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
| |||
101 | 105 | | |
102 | 106 | | |
103 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
104 | 111 | | |
105 | | - | |
| 112 | + | |
106 | 113 | | |
107 | 114 | | |
108 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2088 | 2088 | | |
2089 | 2089 | | |
2090 | 2090 | | |
2091 | | - | |
| 2091 | + | |
| 2092 | + | |
2092 | 2093 | | |
2093 | 2094 | | |
2094 | 2095 | | |
| |||
0 commit comments