Created
November 1, 2013 22:31
-
-
Save weltling/7273037 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/fann.c b/fann.c | |
index 9cb3171..531ad19 100644 | |
--- a/fann.c | |
+++ b/fann.c | |
@@ -933,7 +933,9 @@ ZEND_GET_MODULE(fann) | |
/* macro for chencking fann_error structs */ | |
#define PHP_FANN_ERROR_CHECK(__fann_struct) \ | |
- if (fann_get_errno((struct fann_error *) __fann_struct) != 0) { \ | |
+ if (NULL == __fann_struct) { \ | |
+ RETURN_FALSE; \ | |
+ } else if (fann_get_errno((struct fann_error *) __fann_struct) != 0) { \ | |
php_error_docref(NULL TSRMLS_CC, E_WARNING, __fann_struct->errstr); \ | |
RETURN_FALSE; \ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment