projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Unref: handle null pointers
[babeltrace.git]
/
types
/
types.c
diff --git
a/types/types.c
b/types/types.c
index 80ba4eae69a03f809ae6a768db521beb23e4bdfd..08324acc481dd5e594525282d3329d4a15459f41 100644
(file)
--- a/
types/types.c
+++ b/
types/types.c
@@
-255,6
+255,8
@@
void declaration_ref(struct declaration *declaration)
void declaration_unref(struct declaration *declaration)
{
void declaration_unref(struct declaration *declaration)
{
+ if (!declaration)
+ return;
if (!--declaration->ref)
declaration->declaration_free(declaration);
}
if (!--declaration->ref)
declaration->declaration_free(declaration);
}
@@
-266,6
+268,8
@@
void definition_ref(struct definition *definition)
void definition_unref(struct definition *definition)
{
void definition_unref(struct definition *definition)
{
+ if (!definition)
+ return;
if (!--definition->ref)
definition->declaration->definition_free(definition);
}
if (!--definition->ref)
definition->declaration->definition_free(definition);
}
@@
-508,6
+512,7
@@
void append_scope_path(const char *path, GArray *q)
quark = g_quark_from_string(str);
g_array_append_val(q, quark);
g_free(str);
quark = g_quark_from_string(str);
g_array_append_val(q, quark);
g_free(str);
+ ptrend++; /* skip current dot */
}
/* last. Check for trailing dot (and discard). */
if (ptrbegin[0] != '\0') {
}
/* last. Check for trailing dot (and discard). */
if (ptrbegin[0] != '\0') {
This page took
0.023563 seconds
and
4
git commands to generate.