| 966 | |
| 967 | |
| 968 | /* Functions for set operation. */ |
| 969 | |
| 970 | static reg_errcode_t |
| 971 | internal_function |
| 972 | re_node_set_alloc (re_node_set *set, int size) |
| 973 | { |
| 974 | /* |
| 975 | * ADR: valgrind says size can be 0, which then doesn't |
| 976 | * free the block of size 0. Harumph. This seems |
| 977 | * to work ok, though. |
| 978 | */ |
| 979 | if (size == 0) |
| 980 | { |
| 981 | memset(set, 0, sizeof(*set)); |
| 982 | return REG_NOERROR; |
| 983 | } |
| 984 | set->alloc = size; |
| 985 | set->nelem = 0; |
| 986 | set->elems = re_malloc (int, size); |
| 987 | if (BE (set->elems == NULL, 0)) |
| 988 | return REG_ESPACE; |
| 989 | return REG_NOERROR; |
| 990 | } |
| 991 |
no outgoing calls
no test coverage detected