-
Notifications
You must be signed in to change notification settings - Fork 243
erpcgen: Fix templates for malloc errors. #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
erpcgen: Fix templates for malloc errors. #110
Conversation
16f9777 to
52fb3c1
Compare
|
Hello @AdithyaBaglody , the situation with memory allocation checking is not ideal, I agree. However, your pull request solves structures only and that is not systematic to cover just one of all possible data types. Would you be willing to update the patch and cover all supported cases? Also, it is necessary to follow the coding style and not putting if conditional statements on a single line - instead it is required to use curly brackets and put the command in it. Thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @AdithyaBaglody , the situation with memory allocation checking is not ideal, I agree. However, your pull request solves structures only and that is not systematic to cover just one of all possible data types. Would you be willing to update the patch and cover all supported cases? Also, it is necessary to follow the coding style and not putting if conditional statements on a single line - instead it is required to use curly brackets and put the command in it. Thank you.
52fb3c1 to
cbba960
Compare
@MichalPrincNXP I did some changes in the patch to conform to the coding standards. Also i have added a few more conditions for other data types aswell. I did a few cases and saw all the malloc'd variables were protected. Since i am not familiar with all the supported cases, i am not sure how much i can help in getting them fixed. |
|
@MichalPrincNXP hi did you get a chance to review these changes? |
cbba960 to
36b742d
Compare
If during the execution of the code the malloc fails to allocate memory appropriate checks are needed for safe execution. This patch introduces new checks to ensure safe execution. Signed-off-by: Adithya Baglody <[email protected]>
|
Hello @AdithyaBaglody , I am sorry for delayed response ... looking at your pull request again, I have several comments: Regards |
Fix code style. Signed-off-by: Cervenka Dusan <[email protected]>
Signed-off-by: Cervenka Dusan <[email protected]>
|
Hi, i reviewed the changes. I reverted changes which where not related to return from struct/union read/write functions when data are NULL. I also fixed formatting code. |
|
Thank you for your contribution. Your changes can be still found on your branch in history before my commits. |
|
Thank you! |

If during the execution of the code the malloc fails to allocate
memory, appropriate checks are needed for safe execution.
This patch introduces new checks to ensure safe execution.